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

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.datasource.parser.AbstractParser
      extended by de.lmu.ifi.dbs.elki.datasource.parser.NumberVectorLabelParser<FloatVector>
          extended by de.lmu.ifi.dbs.elki.datasource.parser.FloatVectorLabelParser
All Implemented Interfaces:
LinebasedParser, Parser, InspectionUtilFrequentlyScanned, Parameterizable

public class FloatVectorLabelParser
extends NumberVectorLabelParser<FloatVector>

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

Numerical values in a line will be parsed as double values but used in float precision only.

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 FloatVectorLabelParser.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
FloatVectorLabelParser(Pattern colSep, char quoteChar, BitSet labelIndices)
          Constructor.
 
Method Summary
 FloatVector createDBObject(List<Double> attributes)
          Creates a FloatVector out of the given attribute values.
protected  Logging getLogger()
          Get the logger for this class.
protected  VectorFieldTypeInformation<FloatVector> 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

FloatVectorLabelParser

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

Parameters:
colSep -
quoteChar -
labelIndices -
Method Detail

createDBObject

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

Specified by:
createDBObject in class NumberVectorLabelParser<FloatVector>
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<FloatVector> getTypeInformation(int dimensionality)
Description copied from class: NumberVectorLabelParser
Get a prototype object for the given dimensionality.

Specified by:
getTypeInformation in class NumberVectorLabelParser<FloatVector>
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)