@GwtCompatible public interface PeekingIterator<E> extends Iterator<E>
See the Guava User Guide article on
|Modifier and Type||Method and Description|
Returns the next element in the iteration.
Returns the next element in the iteration, without advancing the iteration.
Removes from the underlying collection the last element returned by this iterator (optional operation).
peek() should not change the state of the iteration, except that it
may prevent removal of the most recent element via
NoSuchElementException- if the iteration has no more elements according to
@CanIgnoreReturnValue E next()
The objects returned by consecutive calls to
guaranteed to be equal to each other.
Iterator.next(). The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method.
Implementations may or may not support removal when a call to
peek() has occurred
since the most recent call to
Copyright © 2010–2018. All rights reserved.