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() |
protected abstract boolean isClosed()
protected abstract boolean doHasNext()
protected abstract T doNext()
protected abstract void doRemove()
Copyright © 2004–2015 The Apache Software Foundation. All rights reserved.