@GwtCompatible public interface PeekingIterator<E> extends java.util.Iterator<E>
E peek()
Calls to peek()
should not change the state of the iteration,
except that it may prevent removal of the most recent element via
remove()
.
java.util.NoSuchElementException
- if the iteration has no more elements
according to Iterator.hasNext()
E next()
The objects returned by consecutive calls to peek()
then next()
are guaranteed to be equal to each other.
next
in interface java.util.Iterator<E>
void remove()