Package eu.bandm.tools.util.java
Interface Iterators.MultipleLookaheadIterator<E>
- Type Parameters:
E- the element type
- All Superinterfaces:
Iterator<E>
- Enclosing class:
Iterators
Iterators which allow arbitrary deep look-ahead.
-
Method Summary
Methods inherited from interface java.util.Iterator
forEachRemaining, hasNext, next, remove
-
Method Details
-
hasNext
boolean hasNext(int k) Checks whether there arek+1more elements.hasNext(0)is equivalent tohasNext().- Parameters:
k- a nonnegative number- Returns:
trueifnextmay be calledk+1times- Throws:
IllegalArgumentException- ifkis negative- See Also:
-
lookahead
Returns the element that comes afterkskipped elements, without changing the state of the iterator.lookahead(0)returns the element that would also be returned bynext.- Parameters:
k- a nonnegative number- Returns:
- the
k+1-th element - Throws:
NoSuchElementException- if there are not enough remaining elements
-