Package generic.util
Class WrappingPeekableIterator<T>
java.lang.Object
generic.util.AbstractPeekableIterator<T>
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.-
Field Summary
Fields inherited from class generic.util.AbstractPeekableIterator
next, soughtNext -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidremove()protected TseekNext()Find the next element in this iterator, because the client called eitherAbstractPeekableIterator.nextorAbstractPeekableIterator.peek().Methods inherited from class generic.util.AbstractPeekableIterator
hasNext, next, peekMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
WrappingPeekableIterator
Wrap the given iterator- Parameters:
iterator- the iterator- See Also:
-
-
Method Details
-
remove
public void remove() -
seekNext
Description copied from class:AbstractPeekableIteratorFind the next element in this iterator, because the client called eitherAbstractPeekableIterator.nextorAbstractPeekableIterator.peek().- Specified by:
seekNextin classAbstractPeekableIterator<T>- Returns:
- the next element
-