Class DelegatingResultRow
java.lang.Object
cz.cvut.kbss.ontodriver.iteration.DelegatingResultRow
- All Implemented Interfaces:
ResultRow
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
findColumn
(String columnLabel) Retrieves index of a column with the specified label.boolean
getBoolean
(int columnIndex) Retrieves value from column at the specified index and returns it as aboolean
.boolean
getBoolean
(String columnLabel) Retrieves value from column with the specified label and returns it as aboolean
.byte
getByte
(int columnIndex) Retrieves value from column at the specified index and returns it asbyte
.byte
Retrieves value from column with the specified label and returns it asbyte
.int
Gets the count of available columns.double
getDouble
(int columnIndex) Retrieves value from column at the specified index and returns it asdouble
.double
Retrieves value from column with the specified label and returns it asdouble
.float
getFloat
(int columnIndex) Retrieves value from column at the specified index and returns it asfloat
.float
Retrieves value from column with the specified label and returns it asfloat
.int
getIndex()
Gets the index of this row (first row has index 0).int
getInt
(int columnIndex) Retrieves value from column at the specified index and returns it asint
.int
Retrieves value from column with the specified label and returns it asint
.long
getLong
(int columnIndex) Retrieves value from column at the specified index and returns it aslong
.long
Retrieves value from column with the specified label and returns it aslong
.getObject
(int columnIndex) Retrieves value from column at the specified index and returns it asObject
.<T> T
Retrieves 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> T
Retrieves value from column with the specified label and returns it as an instance of the specified class.short
getShort
(int columnIndex) Retrieves value of column at the specified index and returns it asshort
.short
Retrieves value of column with the specified label and returns it asshort
.getString
(int columnIndex) Retrieves value of column at the specified index and returns it asString
.Retrieves value of column with the specified label and returns it asString
.boolean
isBound
(int variableIndex) Checks whether a value at the specified index is bound in the current result row.boolean
Checks whether a value of the specified variable is bound in the current result row.
-
Constructor Details
-
DelegatingResultRow
-
-
Method Details
-
findColumn
Description copied from interface:ResultRow
Retrieves index of a column with the specified label.- Specified by:
findColumn
in interfaceResultRow
- Parameters:
columnLabel
- 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:ResultRow
Gets the count of available columns.This number corresponds to the number of result variables bound in the query.
- Specified by:
getColumnCount
in interfaceResultRow
- Returns:
- Number of columns in the result set
-
isBound
Description copied from interface:ResultRow
Checks whether a value at the specified index is bound in the current result row.Note that this method will return
false
also in case the index is out of range of the variables known to the result set as a whole.- Specified by:
isBound
in interfaceResultRow
- Parameters:
variableIndex
- Index of the variable- Returns:
true
when value is bound in the current row,false
otherwise- Throws:
OntoDriverException
- When unable to resolve binding status
-
isBound
Description copied from interface:ResultRow
Checks whether a value of the specified variable is bound in the current result row.Note that this method will return
false
also in case the variable is not known to the result set at all.- Specified by:
isBound
in interfaceResultRow
- Parameters:
variableName
- Variable name- Returns:
true
when value is bound in the current row,false
otherwise- Throws:
OntoDriverException
- When unable to resolve binding status
-
getBoolean
Description copied from interface:ResultRow
Retrieves value from column at the specified index and returns it as aboolean
.- Specified by:
getBoolean
in interfaceResultRow
- Parameters:
columnIndex
- Column index, the first column has index 0- Returns:
boolean
value- Throws:
OntoDriverException
- If thecolumnIndex
is not a valid column index, the value cannot be cast toboolean
or there occurs some other error
-
getBoolean
Description copied from interface:ResultRow
Retrieves value from column with the specified label and returns it as aboolean
.- Specified by:
getBoolean
in interfaceResultRow
- Parameters:
columnLabel
- Label of the column- Returns:
boolean
value- Throws:
OntoDriverException
- If there is no column with the specified label, the value cannot be cast toboolean
or there occurs some other error
-
getByte
Description copied from interface:ResultRow
Retrieves value from column at the specified index and returns it asbyte
.- Specified by:
getByte
in interfaceResultRow
- Parameters:
columnIndex
- Column index, the first column has index 0- Returns:
byte
value- Throws:
OntoDriverException
- If thecolumnIndex
is not a valid column index, the value cannot be cast tobyte
or there occurs some other error
-
getByte
Description copied from interface:ResultRow
Retrieves value from column with the specified label and returns it asbyte
.- Specified by:
getByte
in interfaceResultRow
- Parameters:
columnLabel
- Label of the column- Returns:
byte
value- Throws:
OntoDriverException
- If there is no column with the specified label, the value cannot be cast tobyte
or there occurs some other error
-
getDouble
Description copied from interface:ResultRow
Retrieves value from column at the specified index and returns it asdouble
.- Specified by:
getDouble
in interfaceResultRow
- Parameters:
columnIndex
- Column index, the first column has index 0- Returns:
double
value- Throws:
OntoDriverException
- If thecolumnIndex
is not a valid column index, the value cannot be cast todouble
or there occurs some other error
-
getDouble
Description copied from interface:ResultRow
Retrieves value from column with the specified label and returns it asdouble
.- Specified by:
getDouble
in interfaceResultRow
- Parameters:
columnLabel
- Label of the column- Returns:
double
value- Throws:
OntoDriverException
- If there is no column with the specified label, the value cannot be cast todouble
or there occurs some other error
-
getFloat
Description copied from interface:ResultRow
Retrieves value from column at the specified index and returns it asfloat
.- Specified by:
getFloat
in interfaceResultRow
- Parameters:
columnIndex
- Column index, the first column has index 0- Returns:
float
value- Throws:
OntoDriverException
- If thecolumnIndex
is not a valid column index, the value cannot be cast tofloat
or there occurs some other error
-
getFloat
Description copied from interface:ResultRow
Retrieves value from column with the specified label and returns it asfloat
.- Specified by:
getFloat
in interfaceResultRow
- Parameters:
columnLabel
- Label of the column- Returns:
float
value- Throws:
OntoDriverException
- If there is no column with the specified label, the value cannot be cast tofloat
or there occurs some other error
-
getInt
Description copied from interface:ResultRow
Retrieves value from column at the specified index and returns it asint
.- Specified by:
getInt
in interfaceResultRow
- Parameters:
columnIndex
- Column index, the first column has index 0- Returns:
int
value- Throws:
OntoDriverException
- If thecolumnIndex
is not a valid column index, the value cannot be cast toint
or there occurs some other error
-
getInt
Description copied from interface:ResultRow
Retrieves value from column with the specified label and returns it asint
.- Specified by:
getInt
in interfaceResultRow
- Parameters:
columnLabel
- Label of the column- Returns:
int
value- Throws:
OntoDriverException
- If there is no column with the specified label, the value cannot be cast toint
or there occurs some other error
-
getLong
Description copied from interface:ResultRow
Retrieves value from column at the specified index and returns it aslong
.- Specified by:
getLong
in interfaceResultRow
- Parameters:
columnIndex
- Column index, the first column has index 0- Returns:
long
value- Throws:
OntoDriverException
- If thecolumnIndex
is not a valid column index, the value cannot be cast tolong
or there occurs some other error
-
getLong
Description copied from interface:ResultRow
Retrieves value from column with the specified label and returns it aslong
.- Specified by:
getLong
in interfaceResultRow
- Parameters:
columnLabel
- Label of the column- Returns:
long
value- Throws:
OntoDriverException
- If there is no column with the specified label, the value cannot be cast tolong
or there occurs some other error
-
getObject
Description copied from interface:ResultRow
Retrieves value from column at the specified index and returns it asObject
.- Specified by:
getObject
in interfaceResultRow
- Parameters:
columnIndex
- Column index, the first column has index 0- Returns:
- column value cast to
Object
- Throws:
OntoDriverException
- If thecolumnIndex
is not a valid column index or there occurs some other error
-
getObject
Description copied from interface:ResultRow
Retrieves value from column with the specified label and returns it asObject
.- Specified by:
getObject
in interfaceResultRow
- Parameters:
columnLabel
- Label of the column- Returns:
- column value cast to
Object
- Throws:
OntoDriverException
- If there is no column with the specified label or there occurs some other error
-
getObject
Description copied from interface:ResultRow
Retrieves 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.
- Specified by:
getObject
in interfaceResultRow
- Type Parameters:
T
- Return type- Parameters:
columnIndex
- Column index, the first column has index 0cls
- Requested class type- Returns:
- Value of the column
- Throws:
OntoDriverException
- If thecolumnIndex
is not a valid column index, the value cannot be cast to the specified type or there occurs some other error
-
getObject
Description copied from interface:ResultRow
Retrieves 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.
- Specified by:
getObject
in interfaceResultRow
- Type Parameters:
T
- Return type- Parameters:
columnLabel
- Label of the columncls
- Requested class type- Returns:
- Value of the column.
- Throws:
OntoDriverException
- If there is no column with the specified label, the value cannot be cast to the specified type or there occurs some other error
-
getShort
Description copied from interface:ResultRow
Retrieves value of column at the specified index and returns it asshort
.- Specified by:
getShort
in interfaceResultRow
- Parameters:
columnIndex
- Column index, the first column has index 0- Returns:
short
value- Throws:
OntoDriverException
- If thecolumnIndex
is not a valid column index, the value cannot be cast toshort
or there occurs some other error
-
getShort
Description copied from interface:ResultRow
Retrieves value of column with the specified label and returns it asshort
.- Specified by:
getShort
in interfaceResultRow
- Parameters:
columnLabel
- Label of the column- Returns:
short
value- Throws:
OntoDriverException
- If there is no column with the specified label, the value cannot be cast toshort
or there occurs some other error
-
getString
Description copied from interface:ResultRow
Retrieves value of column at the specified index and returns it asString
.- Specified by:
getString
in interfaceResultRow
- Parameters:
columnIndex
- Column index, the first column has index 0- Returns:
String
value- Throws:
OntoDriverException
- If thecolumnIndex
is not a valid column index, the value cannot be cast toString
or there occurs some other error
-
getString
Description copied from interface:ResultRow
Retrieves value of column with the specified label and returns it asString
.- Specified by:
getString
in interfaceResultRow
- Parameters:
columnLabel
- Label of the column- Returns:
String
value- Throws:
OntoDriverException
- If there is no column with the specified label, the value cannot be cast toString
or there occurs some other error
-
getIndex
Description copied from interface:ResultRow
Gets the index of this row (first row has index 0).- Specified by:
getIndex
in interfaceResultRow
- Returns:
- Index of this row
- Throws:
OntoDriverException
- If some other error occurs
-