Class LazyMutableClosableIteration
java.lang.Object
org.eclipse.rdf4j.federated.evaluation.iterator.LazyMutableClosableIteration
- All Implemented Interfaces:
AutoCloseable,Iterator<BindingSet>,CloseableIteration<BindingSet>
A specialized
CloseableIteration that allows repetitive iterations after resetting the cursor using
resetCursor().
Note that the inner iteration is lazily consumed.
- Author:
- Andreas Schwarte
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<BindingSet>protected intthe cursor index, is used after the inner iteration is fully consumedprotected final CloseableIteration<BindingSet> -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.rdf4j.common.iteration.CloseableIteration
streamMethods inherited from interface java.util.Iterator
forEachRemaining
-
Field Details
-
inner
-
consumed
-
cursorIdx
protected volatile int cursorIdxthe cursor index, is used after the inner iteration is fully consumed
-
-
Constructor Details
-
LazyMutableClosableIteration
-
-
Method Details
-
hasNext
- Specified by:
hasNextin interfaceIterator<BindingSet>- Throws:
QueryEvaluationException
-
next
- Specified by:
nextin interfaceIterator<BindingSet>- Throws:
QueryEvaluationException
-
remove
- Specified by:
removein interfaceIterator<BindingSet>- Throws:
QueryEvaluationException
-
close
Description copied from interface:CloseableIterationCloses this iteration, freeing any resources that it is holding. If the iteration has already been closed then invoking this method has no effect.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseableIteration<BindingSet>- Throws:
QueryEvaluationException
-
resetCursor
public void resetCursor()Reset the cursor to read from the already consumed bindings.
-