CloseableIterator<Object>
, Closeable
, AutoCloseable
, Iterator<Object>
SamPairUtil.SetMateInfoIterator
public class PeekableIterator<Object> extends Object implements CloseableIterator<Object>
Constructor | Description |
---|---|
PeekableIterator(Iterator<Object> iterator) |
Constructs a new iterator that wraps the supplied iterator.
|
Modifier and Type | Method | 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.
|
stream, toList
forEachRemaining
public void close()
close
in interface AutoCloseable
close
in interface Closeable
close
in interface CloseableIterator<Object>
public boolean hasNext()
public Object next()
public Object peek()