Package generic.util
Class WrappingPeekableIterator<T>
java.lang.Object
generic.util.WrappingPeekableIterator<T>
- Type Parameters:
T- the type of the iterator
- All Implemented Interfaces:
PeekableIterator<T>,Iterator<T>
An implementation of
PeekableIterator that can take a Java Iterator and
wrap it to implement the PeekableIterator interface.-
Constructor Details
-
WrappingPeekableIterator
-
-
Method Details
-
hasNext
public boolean hasNext() -
next
-
remove
public void remove() -
peek
Description copied from interface:PeekableIteratorReturns the item that would be returned by callingIterator.next(), but does not increment the iterator asnextwould.- Specified by:
peekin interfacePeekableIterator<T>- Returns:
- the item that would be returned by calling
Iterator.next() - Throws:
NoSuchElementException
-