public class PeekableIterator<Object> extends java.lang.Object implements CloseableIterator<Object>
| Constructor and Description |
|---|
PeekableIterator(java.util.Iterator<Object> iterator)
Constructs a new iterator that wraps the supplied iterator.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the underlying iterator.
|
boolean |
hasNext()
True if there are more items, in which case both next() and peek() will return a value.
|
Object |
next()
Returns the next object and advances the iterator.
|
Object |
peek()
Returns the next object but does not advance the iterator.
|
void |
remove()
Unsupported Operation.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitstream, toListpublic PeekableIterator(java.util.Iterator<Object> iterator)
public void close()
close in interface CloseableIterator<Object>close in interface java.io.Closeableclose in interface java.lang.AutoCloseablepublic boolean hasNext()
hasNext in interface java.util.Iterator<Object>public Object next()
next in interface java.util.Iterator<Object>public Object peek()
public void remove()
remove in interface java.util.Iterator<Object>