Package org.apache.jena.sparql.resultset
Class ResultSetMem
- java.lang.Object
-
- org.apache.jena.sparql.resultset.ResultSetMem
-
- All Implemented Interfaces:
java.util.Iterator<QuerySolution>,ResultSet,ResultSetRewindable,ResultSetPeekable
- Direct Known Subclasses:
RDFInput
public class ResultSetMem extends java.lang.Object implements ResultSetRewindable, ResultSetPeekable
A result set held in-memory. rewindable.
-
-
Constructor Summary
Constructors Constructor Description ResultSetMem()ResultSetMem(ResultSet qr)Create 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ModelgetResourceModel()Get the model that resources are created against - may be nulljava.util.List<java.lang.String>getResultVars()Get the variable names for the projectionintgetRowNumber()Return the "row" number for the current iterator itembooleanhasNext()Is there another possibility?QuerySolutionnext()Moves onto the next result possibility.BindingnextBinding()Move to the next binding (low level)QuerySolutionnextSolution()Moves onto the next result possibility.QuerySolutionpeek()Peek at the next query solutionBindingpeekBinding()Peek at the next bindingvoidreset()Move back to the start of the iterator for this instance of results of a query.voidrewind()Reset this result set back to the beginningintsize()Return the number of rows-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.jena.query.ResultSet
rewindable
-
-
-
-
Constructor Detail
-
ResultSetMem
public ResultSetMem(ResultSetMem imrs2)
Create an in-memory result set from another one- Parameters:
imrs2- The other QueryResultsMem object
-
ResultSetMem
public ResultSetMem(ResultSetMem imrs2, boolean takeCopy)
Create an in-memory result set from another one- Parameters:
imrs2- The other ResultSetMem objecttakeCopy- Should we copy the rows?
-
ResultSetMem
public ResultSetMem(ResultSet qr)
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
public ResultSetMem(ResultSet... sets)
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 Detail
-
hasNext
public boolean hasNext()
Is there another possibility?- Specified by:
hasNextin interfacejava.util.Iterator<QuerySolution>- Specified by:
hasNextin interfaceResultSet
-
nextSolution
public QuerySolution nextSolution()
Moves onto the next result possibility.- Specified by:
nextSolutionin interfaceResultSet
-
nextBinding
public Binding nextBinding()
Description copied from interface:ResultSetMove to the next binding (low level)- Specified by:
nextBindingin interfaceResultSet
-
next
public QuerySolution next()
Moves onto the next result possibility. The returned object should be of class QuerySolution- Specified by:
nextin interfacejava.util.Iterator<QuerySolution>- Specified by:
nextin interfaceResultSet
-
rewind
public void rewind()
Reset this result set back to the beginning
-
reset
public void reset()
Description copied from interface:ResultSetRewindableMove back to the start of the iterator for this instance of results of a query.- Specified by:
resetin interfaceResultSetRewindable
-
getRowNumber
public int getRowNumber()
Return the "row" number for the current iterator item- Specified by:
getRowNumberin interfaceResultSet
-
getResourceModel
public Model getResourceModel()
Description copied from interface:ResultSetGet the model that resources are created against - may be null- Specified by:
getResourceModelin interfaceResultSet
-
size
public int size()
Return the number of rows- Specified by:
sizein interfaceResultSetRewindable
-
getResultVars
public java.util.List<java.lang.String> getResultVars()
Get the variable names for the projection- Specified by:
getResultVarsin interfaceResultSet
-
peek
public QuerySolution peek()
Description copied from interface:ResultSetPeekablePeek at the next query solution- Specified by:
peekin interfaceResultSetPeekable- Returns:
- Next solution if available
-
peekBinding
public Binding peekBinding()
Description copied from interface:ResultSetPeekablePeek at the next binding- Specified by:
peekBindingin interfaceResultSetPeekable- Returns:
- Next binding if available
-
-