Class AbstractCloseableIterator<E>
java.lang.Object
org.eclipse.rdf4j.common.iterator.AbstractCloseableIterator<E>
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Iterator<E>
- Direct Known Subclasses:
LookAheadIterator
- Author:
- MJAHale
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal void
close()
CallshandleClose()
upon first call and makes sure this method gets called only once.protected void
protected void
Called byclose()
when it is called for the first time.final boolean
isClosed()
Checks whether this Iterator has been closed.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining, hasNext, next, remove
-
Constructor Details
-
AbstractCloseableIterator
public AbstractCloseableIterator()
-
-
Method Details
-
isClosed
public final boolean isClosed()Checks whether this Iterator has been closed.- Returns:
- true if the Iterator has been closed, false otherwise.
-
close
CallshandleClose()
upon first call and makes sure this method gets called only once.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
handleClose
Called byclose()
when it is called for the first time. This method is only called once on each iteration. By default, this method does nothing. -
handleAlreadyClosed
- Throws:
IOException
-