public class LookaheadReader extends Lookahead<Char>
Helps to read characters from a Reader one after another. Using next, upcoming characters can be
inspected without consuming (removing) the current one.
endOfInputIndicator, endReached, itemBuffer, problemCollector| Constructor and Description |
|---|
LookaheadReader(Reader input)
Creates a new LookaheadReader for the given Reader.
|
| Modifier and Type | Method and Description |
|---|---|
protected Char |
endOfInput()
Creates the end of input indicator item.
|
protected Char |
fetch()
Fetches the next item from the stream.
|
String |
toString() |
consume, consume, current, getProblemCollector, next, next, setProblemCollectorpublic LookaheadReader(Reader input)
Internally a BufferedReader is used to efficiently read single characters. The given reader will not be
closed by this class.
input - the reader to draw the input fromprotected Char endOfInput()
LookaheadThis method will be only called once, as the indicator is cached.
endOfInput in class Lookahead<Char>protected Char fetch()
LookaheadCopyright © 2019. All rights reserved.