public abstract class AbstractInputParser extends AbstractIterator<String[]> implements Iterable<String[]>, CloseableIterator<String[]>
next
Constructor and Description |
---|
AbstractInputParser() |
Modifier and Type | Method and Description |
---|---|
protected String[] |
advance() |
protected void |
calculateWordCount(byte[] line)
Calculates the number of delimiter-separated "words" in a line and sets the value of
wordCount |
abstract void |
close()
Closes this stream and releases any system resources associated with it.
|
abstract String |
getFileName() |
protected int |
getWordCount() |
protected boolean |
isBlank(byte[] line)
Determines whether a given line is a comment
|
protected boolean |
isComment(byte[] line)
Determines whether a given line is a comment
|
protected boolean |
isDelimiter(byte b)
Determines whether a given character is a delimiter
|
protected boolean |
isSkipBlankLines() |
protected boolean |
isTreatGroupedDelimitersAsOne() |
Iterator<String[]> |
iterator() |
protected abstract byte[] |
readNextLine() |
protected void |
setSkipBlankLines(boolean skipBlankLines) |
protected void |
setTreatGroupedDelimitersAsOne(boolean treatGroupedDelimitersAsOne) |
protected void |
setWordCount(int wordCount) |
hasNext, isIterating, next, peek, remove
public abstract void close()
close
in interface CloseableIterator<String[]>
close
in interface Closeable
close
in interface AutoCloseable
protected abstract byte[] readNextLine()
public abstract String getFileName()
protected String[] advance()
advance
in class AbstractIterator<String[]>
protected void calculateWordCount(byte[] line)
wordCount
line
- representative line from the fileprotected boolean isComment(byte[] line)
line
- the line to evaluateprotected boolean isBlank(byte[] line)
line
- the line to evaluateprotected boolean isDelimiter(byte b)
b
- the character to evaluateb
is a delimiter; otherwise falseprotected int getWordCount()
protected void setWordCount(int wordCount)
protected boolean isTreatGroupedDelimitersAsOne()
protected void setTreatGroupedDelimitersAsOne(boolean treatGroupedDelimitersAsOne)
protected boolean isSkipBlankLines()
protected void setSkipBlankLines(boolean skipBlankLines)