de.lmu.ifi.dbs.elki.datasource.parser
Class DoubleVectorLabelParser

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.datasource.parser.AbstractParser
      extended by de.lmu.ifi.dbs.elki.datasource.parser.NumberVectorLabelParser<DoubleVector>
          extended by de.lmu.ifi.dbs.elki.datasource.parser.DoubleVectorLabelParser
All Implemented Interfaces:
LinebasedParser, Parser, InspectionUtilFrequentlyScanned, Parameterizable
Direct Known Subclasses:
DoubleVectorLabelTransposingParser

public class DoubleVectorLabelParser
extends NumberVectorLabelParser<DoubleVector>

Provides a parser for parsing one point per line, attributes separated by whitespace.

Several labels may be given per point. A label must not be parseable as double. Lines starting with "#" will be ignored.

An index can be specified to identify an entry to be treated as class label. This index counts all entries (numeric and labels as well) starting with 0.


Nested Class Summary
static class DoubleVectorLabelParser.Parameterizer
          Parameterization class.
 
Field Summary
private static Logging logger
          Class logger
 
Fields inherited from class de.lmu.ifi.dbs.elki.datasource.parser.NumberVectorLabelParser
LABEL_INDICES_ID, labelIndices
 
Fields inherited from class de.lmu.ifi.dbs.elki.datasource.parser.AbstractParser
ATTRIBUTE_CONCATENATION, COLUMN_SEPARATOR_ID, COMMENT, NUMBER_PATTERN, QUOTE_CHAR, QUOTE_ID, quoteChar, WHITESPACE_PATTERN
 
Constructor Summary
DoubleVectorLabelParser()
          Constructor with default values.
DoubleVectorLabelParser(Pattern colSep, char quoteChar, BitSet labelIndices)
          Constructor.
 
Method Summary
 DoubleVector createDBObject(List<Double> attributes)
          Creates a DoubleVector out of the given attribute values.
protected  Logging getLogger()
          Get the logger for this class.
protected  VectorFieldTypeInformation<DoubleVector> getTypeInformation(int dimensionality)
          Get a prototype object for the given dimensionality.
 
Methods inherited from class de.lmu.ifi.dbs.elki.datasource.parser.NumberVectorLabelParser
parse, parseLine, parseLineInternal
 
Methods inherited from class de.lmu.ifi.dbs.elki.datasource.parser.AbstractParser
tokenize, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

private static final Logging logger
Class logger

Constructor Detail

DoubleVectorLabelParser

public DoubleVectorLabelParser(Pattern colSep,
                               char quoteChar,
                               BitSet labelIndices)
Constructor.

Parameters:
colSep -
quoteChar -
labelIndices -

DoubleVectorLabelParser

public DoubleVectorLabelParser()
Constructor with default values.

Method Detail

createDBObject

public DoubleVector createDBObject(List<Double> attributes)
Creates a DoubleVector out of the given attribute values.

Specified by:
createDBObject in class NumberVectorLabelParser<DoubleVector>
Parameters:
attributes - the attributes of the vector to create.
Returns:
a RalVector of type V containing the given attribute values
See Also:
NumberVectorLabelParser.createDBObject(java.util.List)

getTypeInformation

protected VectorFieldTypeInformation<DoubleVector> getTypeInformation(int dimensionality)
Description copied from class: NumberVectorLabelParser
Get a prototype object for the given dimensionality.

Specified by:
getTypeInformation in class NumberVectorLabelParser<DoubleVector>
Parameters:
dimensionality - Dimensionality
Returns:
Prototype object

getLogger

protected Logging getLogger()
Description copied from class: AbstractParser
Get the logger for this class.

Specified by:
getLogger in class AbstractParser
Returns:
Logger.

Release 0.4.0 (2011-09-20_1324)