Class CloseableIteratorIteration<E>
- java.lang.Object
-
- org.eclipse.rdf4j.common.iteration.CloseableIteratorIteration<E>
-
- All Implemented Interfaces:
AutoCloseable,Iterator<E>,CloseableIteration<E>
public class CloseableIteratorIteration<E> extends Object implements CloseableIteration<E>
An Iteration that can convert anIteratorto aCloseableIteration.
-
-
Constructor Summary
Constructors Constructor Description CloseableIteratorIteration(Iterator<? extends E> iter)Creates a CloseableIteratorIteration that wraps the supplied iterator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()CallshandleClose()upon first call and makes sure the resource closures are only executed once.protected voidhandleClose()booleanhasNext()booleanisClosed()Checks whether this CloseableIteration has been closed.Enext()voidremove()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.rdf4j.common.iteration.CloseableIteration
stream
-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
-
-
-
Method Detail
-
handleClose
protected void handleClose()
-
isClosed
public final boolean isClosed()
Checks whether this CloseableIteration has been closed.- Returns:
- true if the CloseableIteration has been closed, false otherwise.
-
close
public final void close()
CallshandleClose()upon first call and makes sure the resource closures are only executed once.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseableIteration<E>
-
-