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, setProblemCollector
public 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()
Lookahead
This method will be only called once, as the indicator is cached.
endOfInput
in class Lookahead<Char>
protected Char fetch()
Lookahead
Copyright © 2020. All rights reserved.