public abstract class AbstractCloseableIterator<E> extends Object implements Iterator<E>, Closeable
Constructor and Description |
---|
AbstractCloseableIterator() |
Modifier and Type | Method and Description |
---|---|
void |
close()
Calls
handleClose() upon first call and makes sure this method gets called only once. |
protected void |
handleAlreadyClosed() |
protected void |
handleClose()
Called by
close() when it is called for the first time. |
boolean |
isClosed()
Checks whether this Iterator has been closed.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining, hasNext, next, remove
public final boolean isClosed()
public final void close() throws IOException
handleClose()
upon first call and makes sure this method gets called only once.close
in interface Closeable
close
in interface AutoCloseable
IOException
protected void handleClose() throws IOException
close()
when it is called for the first time. This method is only called once on each iteration.
By default, this method does nothing.X
IOException
protected void handleAlreadyClosed() throws IOException
IOException
Copyright © 2015-2022 Eclipse Foundation. All Rights Reserved.