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). |
<EXTRACTOR extends Extractor<?>> |
extract(Mark mark,
EXTRACTOR extractor,
CSVHeaderInformation optionalData)
Extracts the value specified by the
Mark, previously populated by a call to CharSeeker.seek(Mark, int). |
static boolean |
isEolChar(char c) |
long |
lineNumber() |
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). |
boolean |
tryExtract(Mark mark,
Extractor<?> extractor,
CSVHeaderInformation optionalData)
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 <EXTRACTOR extends Extractor<?>> EXTRACTOR extract(Mark mark, EXTRACTOR extractor, CSVHeaderInformation optionalData)
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.optionalData - holds additional information for spatial and temporal values or nullExtractor, 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, CSVHeaderInformation optionalData)
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.optionalData - holds additional information for spatial and temporal values or nulltrue if a value was extracted, otherwise false. Probably the only reason for
returning false would be if the data to extract was empty.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()
public static boolean isEolChar(char c)
Copyright © 2016–2021 MWARE SOLUTIONS. All rights reserved.