Class SelectResultSet
- All Implemented Interfaces:
ResultSet,AutoCloseable,Iterable<ResultRow>
-
Constructor Summary
ConstructorsConstructorDescriptionSelectResultSet(org.apache.jena.query.QueryExecution execution, org.apache.jena.query.ResultSet jenaResult) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes this result set releasing any sub-resources it holds.intfindColumn(String variableName) Retrieves index of a column with the specified label.booleangetBoolean(int variableIndex) Retrieves value from column at the specified index and returns it as aboolean.booleangetBoolean(String variableName) Retrieves value from column with the specified label and returns it as aboolean.bytegetByte(int variableIndex) Retrieves value from column at the specified index and returns it asbyte.byteRetrieves value from column with the specified label and returns it asbyte.intGets the count of available columns.doublegetDouble(int variableIndex) Retrieves value from column at the specified index and returns it asdouble.doubleRetrieves value from column with the specified label and returns it asdouble.floatgetFloat(int variableIndex) Retrieves value from column at the specified index and returns it asfloat.floatRetrieves value from column with the specified label and returns it asfloat.intgetInt(int variableIndex) Retrieves value from column at the specified index and returns it asint.intRetrieves value from column with the specified label and returns it asint.longgetLong(int variableIndex) Retrieves value from column at the specified index and returns it aslong.longRetrieves value from column with the specified label and returns it aslong.getObject(int variableIndex) Retrieves value from column at the specified index and returns it asObject.<T> TRetrieves value from column at the specified index and returns it as an instance of the specified class.Retrieves value from column with the specified label and returns it asObject.<T> TRetrieves value from column with the specified label and returns it as an instance of the specified class.shortgetShort(int variableIndex) Retrieves value of column at the specified index and returns it asshort.shortRetrieves value of column with the specified label and returns it asshort.getString(int variableIndex) Retrieves value of column at the specified index and returns it asString.Retrieves value of column with the specified label and returns it asString.booleanhasNext()Returns true if the cursor does not point at the last row in this result set.booleanisBound(int variableIndex) Checks whether a value at the specified index is bound in the current result row.booleanChecks whether a value of the specified variable is bound in the current result row.voidnext()Move the cursor one row forward.Methods inherited from class cz.cvut.kbss.ontodriver.jena.query.AbstractResultSet
first, getRowIndex, getStatement, isFirst, isOpen, last, previous, relative, setRowIndexMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface cz.cvut.kbss.ontodriver.ResultSet
iterator, spliterator, stream
-
Constructor Details
-
SelectResultSet
public SelectResultSet(org.apache.jena.query.QueryExecution execution, org.apache.jena.query.ResultSet jenaResult)
-
-
Method Details
-
findColumn
Description copied from interface:ResultSetRetrieves index of a column with the specified label.- Parameters:
variableName- Label of the column- Returns:
- index of the column or -1 if there is no such column
-
getColumnCount
public int getColumnCount()Description copied from interface:ResultSetGets the count of available columns.This number corresponds to the number of result variables bound in the query.
- Returns:
- Number of columns in the result set
-
isBound
public boolean isBound(int variableIndex) Description copied from interface:ResultSetChecks whether a value at the specified index is bound in the current result row.Note that this method will return
falsealso in case the index is out of range of the variables known to the result set as a whole.- Parameters:
variableIndex- Index of the variable- Returns:
truewhen value is bound in the current row,falseotherwise
-
isBound
Description copied from interface:ResultSetChecks whether a value of the specified variable is bound in the current result row.Note that this method will return
falsealso in case the variable is not known to the result set at all.- Parameters:
variableName- Variable name- Returns:
truewhen value is bound in the current row,falseotherwise
-
getBoolean
Description copied from interface:ResultSetRetrieves value from column at the specified index and returns it as aboolean.- Parameters:
variableIndex- Column index, the first column has index 0- Returns:
booleanvalue- Throws:
JenaDriverException
-
getBoolean
Description copied from interface:ResultSetRetrieves value from column with the specified label and returns it as aboolean.- Parameters:
variableName- Label of the column- Returns:
booleanvalue- Throws:
JenaDriverException
-
getByte
Description copied from interface:ResultSetRetrieves value from column at the specified index and returns it asbyte.- Parameters:
variableIndex- Column index, the first column has index 0- Returns:
bytevalue- Throws:
JenaDriverException
-
getByte
Description copied from interface:ResultSetRetrieves value from column with the specified label and returns it asbyte.- Parameters:
variableName- Label of the column- Returns:
bytevalue- Throws:
JenaDriverException
-
getDouble
Description copied from interface:ResultSetRetrieves value from column at the specified index and returns it asdouble.- Parameters:
variableIndex- Column index, the first column has index 0- Returns:
doublevalue- Throws:
JenaDriverException
-
getDouble
Description copied from interface:ResultSetRetrieves value from column with the specified label and returns it asdouble.- Parameters:
variableName- Label of the column- Returns:
doublevalue- Throws:
JenaDriverException
-
getFloat
Description copied from interface:ResultSetRetrieves value from column at the specified index and returns it asfloat.- Parameters:
variableIndex- Column index, the first column has index 0- Returns:
floatvalue- Throws:
JenaDriverException
-
getFloat
Description copied from interface:ResultSetRetrieves value from column with the specified label and returns it asfloat.- Parameters:
variableName- Label of the column- Returns:
floatvalue- Throws:
JenaDriverException
-
getInt
Description copied from interface:ResultSetRetrieves value from column at the specified index and returns it asint.- Parameters:
variableIndex- Column index, the first column has index 0- Returns:
intvalue- Throws:
JenaDriverException
-
getInt
Description copied from interface:ResultSetRetrieves value from column with the specified label and returns it asint.- Parameters:
variableName- Label of the column- Returns:
intvalue- Throws:
JenaDriverException
-
getLong
Description copied from interface:ResultSetRetrieves value from column at the specified index and returns it aslong.- Parameters:
variableIndex- Column index, the first column has index 0- Returns:
longvalue- Throws:
JenaDriverException
-
getLong
Description copied from interface:ResultSetRetrieves value from column with the specified label and returns it aslong.- Parameters:
variableName- Label of the column- Returns:
longvalue- Throws:
JenaDriverException
-
getObject
Description copied from interface:ResultSetRetrieves value from column at the specified index and returns it asObject.- Parameters:
variableIndex- Column index, the first column has index 0- Returns:
- column value cast to
Object
-
getObject
Description copied from interface:ResultSetRetrieves value from column with the specified label and returns it asObject.- Parameters:
variableName- Label of the column- Returns:
- column value cast to
Object
-
getObject
Description copied from interface:ResultSetRetrieves value from column at the specified index and returns it as an instance of the specified class.The mechanism of transforming the value to the specified class is not specified, it can be merely type casting or calling a constructor of the specified type.
- Type Parameters:
T- Return type- Parameters:
variableIndex- Column index, the first column has index 0cls- Requested class type- Returns:
- Value of the column
- Throws:
JenaDriverException
-
getObject
Description copied from interface:ResultSetRetrieves value from column with the specified label and returns it as an instance of the specified class.The mechanism of transforming the value to the specified class is not specified, it can be merely type casting or calling a constructor of the specified type.
- Type Parameters:
T- Return type- Parameters:
variableName- Label of the columncls- Requested class type- Returns:
- Value of the column.
- Throws:
JenaDriverException
-
getShort
Description copied from interface:ResultSetRetrieves value of column at the specified index and returns it asshort.- Parameters:
variableIndex- Column index, the first column has index 0- Returns:
shortvalue- Throws:
JenaDriverException
-
getShort
Description copied from interface:ResultSetRetrieves value of column with the specified label and returns it asshort.- Parameters:
variableName- Label of the column- Returns:
shortvalue- Throws:
JenaDriverException
-
getString
Description copied from interface:ResultSetRetrieves value of column at the specified index and returns it asString.- Parameters:
variableIndex- Column index, the first column has index 0- Returns:
Stringvalue
-
getString
Description copied from interface:ResultSetRetrieves value of column with the specified label and returns it asString.- Parameters:
variableName- Label of the column- Returns:
Stringvalue
-
hasNext
public boolean hasNext()Description copied from interface:ResultSetReturns true if the cursor does not point at the last row in this result set.- Specified by:
hasNextin interfaceResultSet- Overrides:
hasNextin classAbstractResultSet- Returns:
- True if there is at least one next row
-
next
public void next()Description copied from interface:ResultSetMove the cursor one row forward.- Specified by:
nextin interfaceResultSet- Overrides:
nextin classAbstractResultSet
-
close
Description copied from interface:ResultSetCloses this result set releasing any sub-resources it holds.After closing the result set is not usable any more and calling methods on it (except
closeandisOpen) will result inOntoDriverException.Calling
closeon already closed resource does nothing.Calling this method also results in immediate disconnection of all registered observers and cancellation of any running reasoning associated with this result set.
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceResultSet- Overrides:
closein classAbstractResultSet- Throws:
JenaDriverException
-