Package generic.util
Interface PeekableIterator<T>
-
- Type Parameters:
T- The type of this iterator.
- All Superinterfaces:
java.util.Iterator<T>
- All Known Implementing Classes:
WrappingPeekableIterator
public interface PeekableIterator<T> extends java.util.Iterator<T>An iterator that allows you to peek at the next item on the iterator.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Tpeek()Returns the item that would be returned by callingIterator.next(), but does not increment the iterator as next would.
-
-
-
Method Detail
-
peek
T peek() throws java.util.NoSuchElementException
Returns the item that would be returned by callingIterator.next(), but does not increment the iterator as next would.- Returns:
- the item that would be returned by calling
Iterator.next() - Throws:
java.util.NoSuchElementException
-
-