public class BufferedCharSeeker extends Object implements CharSeeker
BufferedReader for a Reader.SourceTraceability.AdapterEMPTY| Constructor and Description |
|---|
BufferedCharSeeker(Source source,
Configuration config) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
<EXTRACTOR extends Extractor<?>> |
extract(Mark mark,
EXTRACTOR extractor)
Extracts the value specified by the
Mark, previously populated by a call to CharSeeker.seek(Mark, int). |
long |
lineNumber()
1-based line number of the current data source.
|
long |
position() |
boolean |
seek(Mark mark,
int untilChar)
Seeks the next occurrence of any of the characters in
untilOneOfChars, or if end-of-line,
or even end-of-file. |
String |
sourceDescription() |
String |
toString() |
boolean |
tryExtract(Mark mark,
Extractor<?> extractor)
Extracts the value specified by the
Mark, previously populated by a call to CharSeeker.seek(Mark, int). |
public BufferedCharSeeker(Source source, Configuration config)
public boolean seek(Mark mark, int untilChar) throws IOException
CharSeekeruntilOneOfChars, or if end-of-line,
or even end-of-file.seek in interface CharSeekermark - the mutable Mark which will be updated with the findings, if any.untilChar - array of characters to seek.false if the end was reached and hence no value found, otherwise true.IOException - in case of I/O error.public <EXTRACTOR extends Extractor<?>> EXTRACTOR extract(Mark mark, EXTRACTOR extractor)
CharSeekerMark, previously populated by a call to CharSeeker.seek(Mark, int).extract in interface CharSeekermark - the Mark specifying which part of a bigger piece of data contains the found value.extractor - Extractor capable of extracting the value.Extractor, which after the call carries the extracted value itself,
where either Extractor.value() or a more specific accessor method can be called to access the value.public boolean tryExtract(Mark mark, Extractor<?> extractor)
CharSeekerMark, previously populated by a call to CharSeeker.seek(Mark, int).tryExtract in interface CharSeekermark - the Mark specifying which part of a bigger piece of data contains the found value.extractor - Extractor capable of extracting the value.true if a value was extracted, otherwise false. Probably the only reason for
returning false would be if the data to extract was empty.public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic long position()
position in interface SourceTraceabilitypublic String sourceDescription()
sourceDescription in interface SourceTraceabilitypublic long lineNumber()
SourceTraceabilitylineNumber in interface SourceTraceabilityCopyright © 2002–2016 The Neo4j Graph Database Project. All rights reserved.