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
Modifier and TypeFieldDescriptionprotected List<BindingSet>
protected int
the cursor index, is used after the inner iteration is fully consumedprotected final CloseableIteration<BindingSet>
-
Constructor Summary
-
Method Summary
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
-
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:
hasNext
in interfaceIterator<BindingSet>
- Throws:
QueryEvaluationException
-
next
- Specified by:
next
in interfaceIterator<BindingSet>
- Throws:
QueryEvaluationException
-
remove
- Specified by:
remove
in interfaceIterator<BindingSet>
- Throws:
QueryEvaluationException
-
close
Description copied from interface:CloseableIteration
Closes 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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseableIteration<BindingSet>
- Throws:
QueryEvaluationException
-
resetCursor
public void resetCursor()Reset the cursor to read from the already consumed bindings.
-