Package eu.bandm.tools.util.java
Interface Iterators.LookaheadIterator<A>
- Type Parameters:
A
- the element type
- All Superinterfaces:
Iterator<A>
- All Known Subinterfaces:
Iterators.PushbackIterator<A>
- Enclosing class:
Iterators
Iterators that can look one element ahead.
-
Method Summary
Methods inherited from interface java.util.Iterator
forEachRemaining, hasNext, next, remove
-
Method Details
-
lookahead
A lookahead()Returns the next element without changing the state of the iterator.This method my be called precisely when
next
may also be called. The returned value is the same. The observable state of the iterator is not changed: Subsequent calls tolookahead
, and one subsequent call tonext
will return the same element.- Returns:
- the next element
- Throws:
NoSuchElementException
- if there are no more elements
-