Package eu.bandm.tools.util.java
Interface Iterators.PushbackIterator<A>
- Type Parameters:
A
- the element type
- All Superinterfaces:
Iterator<A>
,Iterators.LookaheadIterator<A>
- Enclosing class:
Iterators
Iterators that can push an element back into the sequence.
-
Method Summary
Methods inherited from interface java.util.Iterator
forEachRemaining, hasNext, next, remove
Methods inherited from interface eu.bandm.tools.util.java.Iterators.LookaheadIterator
lookahead
-
Method Details
-
pushback
Push an element back into the sequence.This method may be called either when the iterator is in its initial state, or after
next
and/orremove
have been called. It may not be called afterlookahead
, or twice in a row.Conversely, pushed back elements may not be removed.
- Parameters:
elem
- the element to push back- Throws:
IllegalStateException
- if the method may not be called just now
-