Class Lookahead2Iterator<E>
java.lang.Object
com.singularsys.jep.configurableparser.Lookahead2Iterator<E>
- Direct Known Subclasses:
LookaheadNIterator
An iterator which stores the next two tokens.
-
Constructor Summary
ConstructorDescriptionDefault constructor.Lookahead2Iterator
(Iterator<E> input) Decorator constructor around an iteratorLookahead2Iterator
(List<E> input) Constructor when the list of tokens is known beforehand. -
Method Summary
-
Constructor Details
-
Lookahead2Iterator
public Lookahead2Iterator()Default constructor. If this constructor is used then thesetInputIterator(Iterator)
method should be called.- Since:
- 3.5
-
Lookahead2Iterator
Constructor when the list of tokens is known beforehand.- Parameters:
input
- the list of tokens
-
Lookahead2Iterator
Decorator constructor around an iterator- Parameters:
input
- the input iterator
-
-
Method Details
-
setInputIterator
Should be called if the default constructor is used.- Parameters:
input
- the new input iterator- Since:
- 3.5
-
peekNext
-
nextnext
-
prev
Return the token just consumed.- Returns:
- the token, or null if no token consumed.
- Since:
- Jep 3.5
-
consume
public void consume()Eat one token. -
toString
-