Class OrderIterator
java.lang.Object
org.eclipse.rdf4j.common.iteration.AbstractCloseableIteration<E,X>
org.eclipse.rdf4j.common.iteration.DelayedIteration<BindingSet,QueryEvaluationException>
org.eclipse.rdf4j.query.algebra.evaluation.iterator.OrderIterator
- All Implemented Interfaces:
AutoCloseable
,CloseableIteration<BindingSet,
,QueryEvaluationException> Iteration<BindingSet,
QueryEvaluationException>
Sorts the input and optionally applies limit and distinct.
- Author:
- James Leigh, Arjohn Kampman
-
Constructor Summary
ConstructorDescriptionOrderIterator
(CloseableIteration<BindingSet, QueryEvaluationException> iter, Comparator<BindingSet> comparator) OrderIterator
(CloseableIteration<BindingSet, QueryEvaluationException> iter, Comparator<BindingSet> comparator, long limit, boolean distinct) OrderIterator
(CloseableIteration<BindingSet, QueryEvaluationException> iter, Comparator<BindingSet> comparator, long limit, boolean distinct, long iterationSyncThreshold) -
Method Summary
Modifier and TypeMethodDescriptionprotected Iteration<BindingSet,
QueryEvaluationException> Creates the iteration that should be iterated over.protected void
decrement
(int amount) protected void
Closes this iteration as well as the underlying iteration if it has already been created and happens to be aCloseableIteration
.protected void
void
remove()
Calls the remove method of the underlying iteration.Methods inherited from class org.eclipse.rdf4j.common.iteration.DelayedIteration
hasNext, next
Methods inherited from class org.eclipse.rdf4j.common.iteration.AbstractCloseableIteration
close, isClosed
-
Constructor Details
-
OrderIterator
public OrderIterator(CloseableIteration<BindingSet, QueryEvaluationException> iter, Comparator<BindingSet> comparator) -
OrderIterator
public OrderIterator(CloseableIteration<BindingSet, QueryEvaluationException> iter, Comparator<BindingSet> comparator, long limit, boolean distinct) -
OrderIterator
public OrderIterator(CloseableIteration<BindingSet, QueryEvaluationException> iter, Comparator<BindingSet> comparator, long limit, boolean distinct, long iterationSyncThreshold)
-
-
Method Details
-
createIteration
protected Iteration<BindingSet,QueryEvaluationException> createIteration() throws QueryEvaluationExceptionDescription copied from class:DelayedIteration
Creates the iteration that should be iterated over. This method is called only once, when the iteration is first needed.- Specified by:
createIteration
in classDelayedIteration<BindingSet,
QueryEvaluationException> - Throws:
QueryEvaluationException
-
increment
- Throws:
QueryEvaluationException
-
decrement
- Throws:
QueryEvaluationException
-
remove
Description copied from class:DelayedIteration
Calls the remove method of the underlying iteration.- Specified by:
remove
in interfaceIteration<BindingSet,
QueryEvaluationException> - Overrides:
remove
in classDelayedIteration<BindingSet,
QueryEvaluationException> - Throws:
QueryEvaluationException
-
handleClose
Description copied from class:DelayedIteration
Closes this iteration as well as the underlying iteration if it has already been created and happens to be aCloseableIteration
.- Overrides:
handleClose
in classDelayedIteration<BindingSet,
QueryEvaluationException> - Throws:
QueryEvaluationException
-