Class DelayedEvaluationIteration
- java.lang.Object
-
- org.eclipse.rdf4j.common.iteration.AbstractCloseableIteration<BindingSet,QueryEvaluationException>
-
- org.eclipse.rdf4j.query.algebra.evaluation.iterator.DelayedEvaluationIteration
-
- All Implemented Interfaces:
java.lang.AutoCloseable,CloseableIteration<BindingSet,QueryEvaluationException>,Iteration<BindingSet,QueryEvaluationException>
public class DelayedEvaluationIteration extends AbstractCloseableIteration<BindingSet,QueryEvaluationException>
Utility class that removes code duplication and makes a precompiled QueryEvaluationStep available as an iteration that may be created and used later.
-
-
Field Summary
Fields Modifier and Type Field Description private QueryEvaluationStepargprivate BindingSetbsprivate CloseableIteration<BindingSet,QueryEvaluationException>iter
-
Constructor Summary
Constructors Constructor Description DelayedEvaluationIteration(QueryEvaluationStep arg, BindingSet bs)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected CloseableIteration<BindingSet,QueryEvaluationException>createIteration()protected voidhandleClose()Closes this iteration as well as the underlying iteration if it has already been created and happens to be aCloseableIteration.booleanhasNext()Calls the hasNext method of the underlying iteration.private voidinitialise()BindingSetnext()Calls the next method of the underlying iteration.voidremove()Calls the remove method of the underlying iteration.-
Methods inherited from class org.eclipse.rdf4j.common.iteration.AbstractCloseableIteration
close, isClosed
-
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
-
-
-
-
Field Detail
-
arg
private final QueryEvaluationStep arg
-
bs
private final BindingSet bs
-
iter
private CloseableIteration<BindingSet,QueryEvaluationException> iter
-
-
Constructor Detail
-
DelayedEvaluationIteration
public DelayedEvaluationIteration(QueryEvaluationStep arg, BindingSet bs)
-
-
Method Detail
-
createIteration
protected CloseableIteration<BindingSet,QueryEvaluationException> createIteration() throws QueryEvaluationException
- Throws:
QueryEvaluationException
-
hasNext
public boolean hasNext() throws QueryEvaluationExceptionCalls the hasNext method of the underlying iteration.- Returns:
- true if the iteration has more elements.
- Throws:
QueryEvaluationException
-
next
public BindingSet next() throws QueryEvaluationException
Calls the next method of the underlying iteration.- Returns:
- the next element in the iteration.
- Throws:
QueryEvaluationException
-
initialise
private void initialise() throws QueryEvaluationException- Throws:
QueryEvaluationException
-
remove
public void remove() throws QueryEvaluationExceptionCalls the remove method of the underlying iteration.- Throws:
QueryEvaluationException
-
handleClose
protected final void handleClose() throws QueryEvaluationExceptionCloses this iteration as well as the underlying iteration if it has already been created and happens to be aCloseableIteration.- Overrides:
handleClosein classAbstractCloseableIteration<BindingSet,QueryEvaluationException>- Throws:
QueryEvaluationException
-
-