Package elki.datasource.parser
Class AbstractStreamingParser
- java.lang.Object
-
- elki.datasource.parser.AbstractStreamingParser
-
- All Implemented Interfaces:
BundleStreamSource,Parser,StreamingParser
- Direct Known Subclasses:
ClusteringVectorParser,NumberVectorLabelParser,SimplePolygonParser,SimpleTransactionParser
public abstract class AbstractStreamingParser extends java.lang.Object implements StreamingParser
Base class for streaming parsers.- Since:
- 0.5.0
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractStreamingParser.ParParameterization class.-
Nested classes/interfaces inherited from interface elki.datasource.bundle.BundleStreamSource
BundleStreamSource.Event
-
-
Field Summary
Fields Modifier and Type Field Description protected TokenizedReaderreaderTokenized reader.protected TokenizertokenizerTokenizer.
-
Constructor Summary
Constructors Constructor Description AbstractStreamingParser(CSVReaderFormat format)Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description MultipleObjectsBundleasMultipleObjectsBundle()Return (or collect) the stream as bundle.booleanassignDBID(DBIDVar var)Assign the current object ID to aDBIDVar.voidcleanup()Perform cleanup operations after parsing.protected abstract LogginggetLogger()Get the logger for this class.booleanhasDBIDs()Indicate whether the stream contains DBIDs.voidinitStream(java.io.InputStream in)Init the streaming parser for the given input stream.MultipleObjectsBundleparse(java.io.InputStream in)Returns a list of the objects parsed from the specified input stream.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface elki.datasource.bundle.BundleStreamSource
data, getMeta, nextEvent
-
-
-
-
Field Detail
-
reader
protected TokenizedReader reader
Tokenized reader.
-
tokenizer
protected Tokenizer tokenizer
Tokenizer.
-
-
Constructor Detail
-
AbstractStreamingParser
public AbstractStreamingParser(CSVReaderFormat format)
Constructor.- Parameters:
format- Reader format
-
-
Method Detail
-
parse
public final MultipleObjectsBundle parse(java.io.InputStream in)
Description copied from interface:ParserReturns a list of the objects parsed from the specified input stream.
-
initStream
public void initStream(java.io.InputStream in)
Description copied from interface:StreamingParserInit the streaming parser for the given input stream.- Specified by:
initStreamin interfaceStreamingParser- Parameters:
in- the stream to parse objects from
-
hasDBIDs
public boolean hasDBIDs()
Description copied from interface:BundleStreamSourceIndicate whether the stream contains DBIDs.- Specified by:
hasDBIDsin interfaceBundleStreamSource- Returns:
trueif the stream contains DBIDs.
-
assignDBID
public boolean assignDBID(DBIDVar var)
Description copied from interface:BundleStreamSourceAssign the current object ID to aDBIDVar.- Specified by:
assignDBIDin interfaceBundleStreamSource- Parameters:
var- Variable to assign the object id to- Returns:
falsewhen no object id is available
-
asMultipleObjectsBundle
public MultipleObjectsBundle asMultipleObjectsBundle()
Description copied from interface:BundleStreamSourceReturn (or collect) the stream as bundle.- Specified by:
asMultipleObjectsBundlein interfaceBundleStreamSource- Returns:
- Bundle
-
cleanup
public void cleanup()
Description copied from interface:ParserPerform cleanup operations after parsing.
-
getLogger
protected abstract Logging getLogger()
Get the logger for this class.- Returns:
- Logger.
-
-