Class IteratingTupleQueryResult
java.lang.Object
org.eclipse.rdf4j.common.iteration.AbstractCloseableIteration<BindingSet>
org.eclipse.rdf4j.common.iteration.IterationWrapper<BindingSet>
org.eclipse.rdf4j.query.impl.IteratingTupleQueryResult
- All Implemented Interfaces:
AutoCloseable, Iterable<BindingSet>, Iterator<BindingSet>, CloseableIteration<BindingSet>, QueryResult<BindingSet>, TupleQueryResult
- Direct Known Subclasses:
BackgroundTupleResult
public class IteratingTupleQueryResult
extends IterationWrapper<BindingSet>
implements TupleQueryResult
An iterating implementation of the
TupleQueryResult interface.-
Field Summary
Fields inherited from class IterationWrapper
wrappedIterModifier and TypeFieldDescriptionprotected final CloseableIteration<? extends BindingSet> Deprecated.This will be changed to private, possibly with an accessor in future.Fields inherited from interface CloseableIteration
EMPTY_STATEMENT_ITERATION -
Constructor Summary
ConstructorsConstructorDescriptionIteratingTupleQueryResult(List<String> bindingNames, Iterable<? extends BindingSet> bindingSets) Creates a query result object with the supplied binding names.IteratingTupleQueryResult(List<String> bindingNames, Iterator<? extends BindingSet> bindingSetIter) IteratingTupleQueryResult(List<String> bindingNames, CloseableIteration<? extends BindingSet> bindingSetIter) Creates a query result object with the supplied binding names. -
Method Summary
Modifier and TypeMethodDescriptionGets the names of the bindings, in order of projection.Methods inherited from class IterationWrapper
handleClose, hasNext, next, removeModifier and TypeMethodDescriptionprotected voidDeprecated.Closes this Iteration and also closes the wrapped Iteration if it is aCloseableIteration.booleanhasNext()Deprecated.Checks whether the wrapped Iteration contains more elements, closing this Iteration when this is not the case.next()Deprecated.Returns the next element from the wrapped Iteration.voidremove()Deprecated.Removes the last element that has been returned from the wrapped Iteration.Methods inherited from class AbstractCloseableIteration
close, isClosedModifier and TypeMethodDescriptionfinal voidclose()CallsAbstractCloseableIteration.handleClose()upon first call and makes sure the resource closures are only executed once.final booleanisClosed()Checks whether this CloseableIteration has been closed.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Iterable
forEach, spliteratorMethods inherited from interface Iterator
forEachRemainingMethods inherited from interface QueryResult
hasNext, iterator, next, streamModifier and TypeMethodDescriptionbooleanhasNext()Returnstrueif the query result has more elements.default Iterator<BindingSet> iterator()next()Returns the next element in the query result.default Stream<BindingSet> stream()Convert the result elements to a JavaStream.
-
Constructor Details
-
IteratingTupleQueryResult
public IteratingTupleQueryResult(List<String> bindingNames, Iterable<? extends BindingSet> bindingSets) Creates a query result object with the supplied binding names. The supplied list of binding names is assumed to be constant; care should be taken that the contents of this list doesn't change after supplying it to this solution.- Parameters:
bindingNames- The binding names, in order of projection.
-
IteratingTupleQueryResult
public IteratingTupleQueryResult(List<String> bindingNames, Iterator<? extends BindingSet> bindingSetIter) -
IteratingTupleQueryResult
public IteratingTupleQueryResult(List<String> bindingNames, CloseableIteration<? extends BindingSet> bindingSetIter) Creates a query result object with the supplied binding names. The supplied list of binding names is assumed to be constant; care should be taken that the contents of this list doesn't change after supplying it to this solution.- Parameters:
bindingNames- The binding names, in order of projection.
-
-
Method Details
-
getBindingNames
Description copied from interface:TupleQueryResultGets the names of the bindings, in order of projection.- Specified by:
getBindingNamesin interfaceTupleQueryResult- Returns:
- The binding names, in order of projection.
- Throws:
QueryEvaluationException
-