java.lang.Object
org.apache.jena.sparql.engine.ResultSetStream
- All Implemented Interfaces:
Iterator<QuerySolution>,ResultSet
- Direct Known Subclasses:
ResultSetAdapter
The main ResultSet implementation for returning results from queries.
This version is "use once" - you can not reset the result set because
the results of the query are not remembered so as not to consume potentially
large amounts of memory.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()static ResultSetCreate a streaming ResultSet, with resources sharing a common Modelstatic ResultSetCreate aResultSetfrom a List<Var> and an Iterator<Binding>.voidforEachRemaining(Consumer<? super QuerySolution> action) org.apache.jena.rdf.model.ModelgetModel()org.apache.jena.rdf.model.ModelGet the model that resources are created against - may be nullGet the variable names for the projectionintReturn the "row number" - a count of the number of possibilities returned so far.booleanhasNext()Is there another possibility?next()Moves onto the next result possibility.Move to the next binding (low level)Moves onto the next result possibility.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.jena.query.ResultSet
materialise, rewindable
-
Method Details
-
create
public static ResultSet create(List<String> resultVars, org.apache.jena.rdf.model.Model m, Iterator<Binding> iter) Create a streaming ResultSet, with resources sharing a common Model -
create
Create aResultSetfrom a List<Var> and an Iterator<Binding>. -
hasNext
public boolean hasNext()Is there another possibility?- Specified by:
hasNextin interfaceIterator<QuerySolution>- Specified by:
hasNextin interfaceResultSet
-
nextBinding
Description copied from interface:ResultSetMove to the next binding (low level)- Specified by:
nextBindingin interfaceResultSet
-
close
public void close() -
nextSolution
Moves onto the next result possibility. The returned object is actual the binding for this result.- Specified by:
nextSolutionin interfaceResultSet
-
next
Moves onto the next result possibility.- Specified by:
nextin interfaceIterator<QuerySolution>- Specified by:
nextin interfaceResultSet
-
forEachRemaining
- Specified by:
forEachRemainingin interfaceIterator<QuerySolution>- Specified by:
forEachRemainingin interfaceResultSet
-
getRowNumber
public int getRowNumber()Return the "row number" - a count of the number of possibilities returned so far. Remains valid (as the total number of possibilities) after the iterator ends.- Specified by:
getRowNumberin interfaceResultSet
-
getResultVars
Get the variable names for the projection- Specified by:
getResultVarsin interfaceResultSet
-
getModel
public org.apache.jena.rdf.model.Model getModel() -
getResourceModel
public org.apache.jena.rdf.model.Model getResourceModel()Description copied from interface:ResultSetGet the model that resources are created against - may be null- Specified by:
getResourceModelin interfaceResultSet
-