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

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.datasource.parser.AbstractParser
      extended by de.lmu.ifi.dbs.elki.datasource.parser.SparseBitVectorLabelParser
All Implemented Interfaces:
Parser, InspectionUtilFrequentlyScanned, Parameterizable

@Title(value="Sparse Bit Vector Label Parser")
@Description(value="Parser for the lines of the following format:\nA single line provides a single sparse BitVector. The indices of the one-bits are separated by whitespace. The first index starts with zero. Any substring not containing whitespace is tried to be read as an Integer. If this fails, it will be appended to a label. (Thus, any label must not be parseable as an Integer.) Empty lines and lines beginning with \"#\" will be ignored.")
public class SparseBitVectorLabelParser
extends AbstractParser
implements Parser

Provides a parser for parsing one sparse BitVector per line, where the indices of the one-bits are separated by whitespace. The first index starts with zero.

Several labels may be given per BitVector, a label must not be parseable as an Integer. Lines starting with "#" will be ignored.


Nested Class Summary
static class SparseBitVectorLabelParser.Parameterizer
          Parameterization class.
 
Field Summary
private static Logging logger
          Class logger
 
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
SparseBitVectorLabelParser(Pattern colSep, char quoteChar)
          Constructor.
 
Method Summary
protected  Logging getLogger()
          Get the logger for this class.
protected  VectorFieldTypeInformation<BitVector> getTypeInformation(int dimensionality)
           
 MultipleObjectsBundle parse(InputStream in)
          Returns a list of the objects parsed from the specified input stream.
 
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

SparseBitVectorLabelParser

public SparseBitVectorLabelParser(Pattern colSep,
                                  char quoteChar)
Constructor.

Parameters:
colSep -
quoteChar -
Method Detail

parse

public MultipleObjectsBundle parse(InputStream in)
Description copied from interface: Parser
Returns a list of the objects parsed from the specified input stream.

Specified by:
parse in interface Parser
Parameters:
in - the stream to parse objects from
Returns:
a list containing those objects parsed from the input stream

getTypeInformation

protected VectorFieldTypeInformation<BitVector> getTypeInformation(int dimensionality)

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)