Interface Row
Table
.
An instance of Row
has a sequence of columns c
1,
c
2, ... , c
n with
n
≥ 1 and consists of a sequence of values v
1,
v
2, ... , v
n such that
v
i is the value stored in the table's row in the column
c
i.
The sequence of columns is given by the columns
argument of those
methods that return rows such as the Table.get(Ref ref, Column<?>... columns)
method, where an empty column
array means the table definition, hence, the table's
characteristic sequence of columns.
It can be assumed that v
i is compatible with the type of column
c
i.
Note that a row is iterable. The order in which the values of an iterated row are returned is naturally defined by its sequence of columns.
There should be no need for clients to implement this interface.
- Author:
- Beat Hörmann
-
Method Summary
Modifier and TypeMethodDescriptionget
(int index) Returns the value with the specified index.<T> T
Returns the value for the specified column.Column<?>[]
The sequence of columns of this row.getRef()
The reference to this row within the table.getTable()
Returns the table this row belongs to.iterator()
Returns an iterator over the values of this row in proper sequence.Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
getTable
Table getTable()Returns the table this row belongs to.- Returns:
- The table, never
null
.
-
getColumns
Column<?>[] getColumns()The sequence of columns of this row.- Returns:
- The columns, never
null
and never an empty array.
-
get
Returns the value for the specified column.- Type Parameters:
T
- The value type of the column.- Parameters:
column
- The column, not allowed to benull
. The column must be a column contained in the column array returned by thegetColumns()
method.- Returns:
- The value of this row for the specified column.
- Throws:
IllegalArgumentException
- Ifcolumn
isnull
or if the row has no value for the specified column.
-
get
Returns the value with the specified index.- Parameters:
index
- The index, must be greater than or equal to zero and less than the length of the column array returned by thegetColumns()
method.- Returns:
- The value with the specified index.
- Throws:
IndexOutOfBoundsException
- If the specified index is less than zero or greater than the row's number of columns.
-
getRef
Ref getRef()The reference to this row within the table.- Returns:
- The reference, never
null
.
-
iterator
Returns an iterator over the values of this row in proper sequence.
-