T
- the type of elements returned by this iteratorpublic abstract class CloseableIterator<T> extends Object implements Iterator<T>
isClosed()
returns true
.
If the iterator has been closed before calling hasNext()
then the method returns false
.
If the iterator was closed after hasNext returns true
but before next()
, the
method next()
throws NoSuchElementException
.
The method remove()
throws IllegalStateException
if the iterator has been closed.Constructor and Description |
---|
CloseableIterator() |
Modifier and Type | Method and Description |
---|---|
protected abstract boolean |
doHasNext() |
protected abstract T |
doNext() |
protected abstract void |
doRemove() |
boolean |
hasNext() |
protected abstract boolean |
isClosed() |
T |
next() |
void |
remove() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining
protected abstract boolean isClosed()
protected abstract boolean doHasNext()
protected abstract T doNext()
protected abstract void doRemove()
Copyright © 2004–2024 The Apache Software Foundation. All rights reserved.