T
- The type of the Iterator (has to be the same as the Iterator
given into the
PeekableIterator
constructor)public class PeekableIteratorWrapper<T> extends Object implements Iterator<T>, PeekableIterator<T>
Iterator
and provides the peeking functionalityConstructor and Description |
---|
PeekableIteratorWrapper(Iterator<T> rootIter) |
Modifier and Type | Method and Description |
---|---|
boolean |
hasNext() |
T |
next() |
T |
peek()
Peeks the very next element.
|
void |
remove()
removal of elements is not supported.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining
public boolean hasNext()
PeekableIterator
public T next()
PeekableIterator
public T peek()
PeekableIterator
Iterator.next()
would
return, with the addition that it will not be consumed directly. The
implementation ensures that the following statement will return true:
peekableIter.peek() == peekableIter.next();
peek
in interface PeekableIterator<T>
public void remove()
UnsupportedOperationException
Copyright © 2024 levigo holding gmbh. All rights reserved.