public interface PeekingIterator<E> extends Iterator<E>
See the Guava User Guide article on
PeekingIterator
.
Modifier and Type | Method and Description |
---|---|
E |
next() |
E |
peek()
Returns the next element in the iteration, without advancing the iteration.
|
void |
remove() |
forEachRemaining, hasNext
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()
.
NoSuchElementException
- if the iteration has no more elements
according to Iterator.hasNext()
E next()
void remove()
Copyright © 2007-2024, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.