public interface Tuple
Different typed access methods are provided for retrieving the result of each column. It is up to the caller to keep track of which is the right one to use. It's done this way so that we can return primitive values.
Note that in most cases a Tuple
instance is also a
TupleSequence
. That means that once the TupleSequence has
been advanced to the next row, calling the Tuple methods will give
different values. It follows that calls to a Tuple instance should
be made and the results consumed synchronously before the next
iteration, such instances are generally not suitable for hanging
on to outside of an iteration step.
The point of separating the two interfaces is to make it clear when a client is only permitted to read the values and not to advance the iterator.
Modifier and Type | Method and Description |
---|---|
boolean |
getBooleanValue(int icol)
Returns the value of a given column as a boolean.
|
double |
getDoubleValue(int icol)
Returns the value of a given column as a double.
|
int |
getIntValue(int icol)
Returns the value of a given column as an integer.
|
long |
getLongValue(int icol)
Returns the value of a given column as a long.
|
Object |
getObjectValue(int icol)
Returns the value of a given column as an object.
|
long |
getRowIndex()
Returns the row index for the underlying data set.
|
long getRowIndex()
Object getObjectValue(int icol)
If the result is a mutable object, its value may be overwritten by
subsequent calls to this method
(especially following calls to TupleSequence.next()
if this
object also implements TupleSequence
).
icol
- column indexicol
,
presumed of object typedouble getDoubleValue(int icol)
icol
- column indexicol
,
presumed of numeric typeint getIntValue(int icol)
icol
- column indexicol
,
presumed of numeric typelong getLongValue(int icol)
icol
- column indexicol
,
presumed of numeric typeboolean getBooleanValue(int icol)
icol
- column indexicol
,
presumed of boolean typeCopyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.