
public abstract class AbstractStreamingParser extends AbstractParser implements StreamingParser
BufferedReader, which recycles
the string builder.AbstractParser.ParameterizerBundleStreamSource.Event| Modifier and Type | Field and Description |
|---|---|
private StringBuilder |
buf
The buffer we read the data into.
|
private int |
lineNumber
Current line number.
|
private LineReader |
reader
Line reader.
|
ATTRIBUTE_CONCATENATION, COMMENT_PATTERN, DEFAULT_SEPARATOR, NUMBER_PATTERN, QUOTE_CHARS, tokenizer| Constructor and Description |
|---|
AbstractStreamingParser(Pattern colSep,
String quoteChars,
Pattern comment)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
MultipleObjectsBundle |
asMultipleObjectsBundle()
Return (or collect) the stream as bundle.
|
boolean |
assignDBID(DBIDVar var)
Assign the current object ID to a
DBIDVar. |
void |
cleanup()
Cleanup internal data structures.
|
protected int |
getLineNumber()
Get the current line number.
|
boolean |
hasDBIDs()
Indicate whether the stream contains DBIDs.
|
void |
initStream(InputStream in)
Init the streaming parser for the given input stream.
|
protected boolean |
nextLineExceptComments()
Read the next line into the tokenizer.
|
MultipleObjectsBundle |
parse(InputStream in)
Returns a list of the objects parsed from the specified input stream.
|
getLogger, isComment, lengthWithoutLinefeed, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdata, getMeta, nextEventprivate LineReader reader
private StringBuilder buf
private int lineNumber
public final MultipleObjectsBundle parse(InputStream in)
Parserpublic void initStream(InputStream in)
StreamingParserinitStream in interface StreamingParserin - the stream to parse objects fromprotected int getLineNumber()
public boolean hasDBIDs()
BundleStreamSourcehasDBIDs in interface BundleStreamSourcetrue if the stream contains DBIDs.public boolean assignDBID(DBIDVar var)
BundleStreamSourceDBIDVar.assignDBID in interface BundleStreamSourcevar - Variable to assign the object id tofalse when no object id is availableprotected boolean nextLineExceptComments()
throws IOException
null.IOExceptionpublic void cleanup()
AbstractParsercleanup in interface Parsercleanup in class AbstractParserpublic MultipleObjectsBundle asMultipleObjectsBundle()
BundleStreamSourceasMultipleObjectsBundle in interface BundleStreamSourceCopyright © 2014 ELKI Development Team, Lehr- und Forschungseinheit für Datenbanksysteme, Ludwig-Maximilians-Universität München. License information.