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 anIterator
to 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 void
close()
CallshandleClose()
upon first call and makes sure the resource closures are only executed once.protected void
handleClose()
boolean
hasNext()
boolean
isClosed()
Checks whether this CloseableIteration has been closed.E
next()
void
remove()
-
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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseableIteration<E>
-
-