java.lang.Object
org.apache.jena.sparql.resultset.ResultSetMem
- All Implemented Interfaces:
Iterator<QuerySolution>
,ResultSet
,ResultSetRewindable
,ResultSetPeekable
- Direct Known Subclasses:
RDFInput
A result set held in-memory. rewindable.
-
Constructor Summary
ConstructorDescriptionCreate an in-memory result set from any ResultSet object.ResultSetMem
(ResultSet... sets) Create an in-memory result set from an array of ResulSets.ResultSetMem
(ResultSetMem imrs2) Create an in-memory result set from another oneResultSetMem
(ResultSetMem imrs2, boolean takeCopy) Create an in-memory result set from another one -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
forEachRemaining
(Consumer<? super QuerySolution> action) org.apache.jena.rdf.model.Model
Get the model that resources are created against - may be nullGet the variable names for the projectionint
Return the "row" number for the current iterator itemboolean
hasNext()
Is there another possibility?next()
Moves onto the next result possibility.Move to the next binding (low level)Moves onto the next result possibility.peek()
Peek at the next query solutionPeek at the next bindingvoid
reset()
Move back to the start of the iterator for this instance of results of a query.void
rewind()
Reset this result set back to the beginningint
size()
Return the number of rowsMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.jena.query.ResultSet
materialise, rewindable
-
Constructor Details
-
ResultSetMem
Create an in-memory result set from another one- Parameters:
imrs2
- The other QueryResultsMem object
-
ResultSetMem
Create an in-memory result set from another one- Parameters:
imrs2
- The other ResultSetMem objecttakeCopy
- Should we copy the rows?
-
ResultSetMem
Create an in-memory result set from any ResultSet object. If the ResultSet is an in-memory one already, then no copying is done - the necessary internal datastructures are shared. This operation destroys (uses up) a ResultSet object that is not an in-memory one. -
ResultSetMem
Create an in-memory result set from an array of ResulSets. It is assumed that all the ResultSets from the array have the same variables.- Parameters:
sets
- the ResultSet objects to concatenate.
-
ResultSetMem
public ResultSetMem()
-
-
Method Details
-
hasNext
public boolean hasNext()Is there another possibility?- Specified by:
hasNext
in interfaceIterator<QuerySolution>
- Specified by:
hasNext
in interfaceResultSet
-
nextSolution
Moves onto the next result possibility.- Specified by:
nextSolution
in interfaceResultSet
-
nextBinding
Description copied from interface:ResultSet
Move to the next binding (low level)- Specified by:
nextBinding
in interfaceResultSet
-
next
Moves onto the next result possibility. The returned object should be of class QuerySolution- Specified by:
next
in interfaceIterator<QuerySolution>
- Specified by:
next
in interfaceResultSet
-
forEachRemaining
- Specified by:
forEachRemaining
in interfaceIterator<QuerySolution>
- Specified by:
forEachRemaining
in interfaceResultSet
-
close
public void close() -
rewind
public void rewind()Reset this result set back to the beginning -
reset
public void reset()Description copied from interface:ResultSetRewindable
Move back to the start of the iterator for this instance of results of a query.- Specified by:
reset
in interfaceResultSetRewindable
-
getRowNumber
public int getRowNumber()Return the "row" number for the current iterator item- Specified by:
getRowNumber
in interfaceResultSet
-
getResourceModel
public org.apache.jena.rdf.model.Model getResourceModel()Description copied from interface:ResultSet
Get the model that resources are created against - may be null- Specified by:
getResourceModel
in interfaceResultSet
-
size
public int size()Return the number of rows- Specified by:
size
in interfaceResultSetRewindable
-
getResultVars
Get the variable names for the projection- Specified by:
getResultVars
in interfaceResultSet
-
peek
Description copied from interface:ResultSetPeekable
Peek at the next query solution- Specified by:
peek
in interfaceResultSetPeekable
- Returns:
- Next solution if available
-
peekBinding
Description copied from interface:ResultSetPeekable
Peek at the next binding- Specified by:
peekBinding
in interfaceResultSetPeekable
- Returns:
- Next binding if available
-