Interface Cursor
- All Superinterfaces:
- java.lang.AutoCloseable
public interface Cursor
extends java.lang.AutoCloseable
Provides access to the results of a query. A cursor can be opened only if a read-only or a read/write transaction is active 
 on the data store connection that the cursor was created on.
- 
Method SummaryModifier and Type Method Description longadvance()Advances the cursor and positions it to the next tuple.booleancanAdvance()Checks whetheradvance()can be called to continue iteration.voidclose()Closes the cursor by freeing all resources associated with it.intgetArity()Returns the arity (i.e., the number of columns) of the answers that the cursor computes.DataStoreConnectiongetDataStoreConnection()Returns the data store connection that this cursor is associated with.ResourcegetResource(int argumentIndex)Returns the resource by for the given index in the current answer row.ResourceValuegetResourceValue(int argumentIndex)Returns the resource bound to the given index in the current answer row.longopen()Opens the cursor and positions it to the first tuple.voidstop()Stops this iterator by releasing all resources that the cursor might hold.
- 
Method Details- 
getDataStoreConnectionReturns the data store connection that this cursor is associated with.- Returns:
- the data store connection that this cursor is associated with
- Throws:
- JRDFoxException- thrown if an error is encountered
 
- 
getArityReturns the arity (i.e., the number of columns) of the answers that the cursor computes.- Returns:
- the arity of the cursor's answers
- Throws:
- JRDFoxException- thrown if an error is encountered
 
- 
openOpens the cursor and positions it to the first tuple. It is allowed to open the cursor more than once.- Returns:
- the multiplicity of the first tuple (0 if there are no tuples)
- Throws:
- JRDFoxException- thrown if an error is encountered
 
- 
canAdvanceChecks whetheradvance()can be called to continue iteration. Iteration cannot be continued if the data store has changed since this cursor was opened.- Returns:
- trueif the data store has not changed since this cursor was opened
- Throws:
- JRDFoxException- thrown if an error is encountered
 
- 
advanceAdvances the cursor and positions it to the next tuple.- Returns:
- the multiplicity of the next tuple (0 if there are no more tuples)
- Throws:
- JRDFoxException- thrown if an error is encountered
 
- 
stopStops this iterator by releasing all resources that the cursor might hold. This method should be called if a cursor is opened but not iterated to the end. It is called automatically afteradvance()returns 0.- Throws:
- JRDFoxException- thrown if an error is encountered
 
- 
closevoid close()Closes the cursor by freeing all resources associated with it. Once a cursor is closed, it cannot be used any further.- Specified by:
- closein interface- java.lang.AutoCloseable
 
- 
getResourceValueReturns the resource bound to the given index in the current answer row.- Parameters:
- argumentIndex- the index of the resource being returned
- Returns:
- the resource at the given index, or nullif the given index in the row is unbound
- Throws:
- JRDFoxException- thrown if an error is encountered
 
- 
getResourceReturns the resource by for the given index in the current answer row.- Parameters:
- argumentIndex- the index of the resource being returned
- Returns:
- the resource corresponding to the given index, or nullif the given index in the row is unbound
- Throws:
- JRDFoxException- thrown if an error is encountered
 
 
-