Package acdp

Interface Row

All Superinterfaces:
Iterable<Object>

public interface Row extends Iterable<Object>
Defines a data structure housing some or all values stored in a particular row of a Table.

An instance of Row has a sequence of columns c1, c2, ... , cn with n ≥ 1 and consists of a sequence of values v1, v2, ... , vn such that vi is the value stored in the table's row in the column ci.

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 vi is compatible with the type of column ci.

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 Type
    Method
    Description
    get(int index)
    Returns the value with the specified index.
    <T> T
    get(Column<T> column)
    Returns the value for the specified column.
    Column<?>[]
    The sequence of columns of this row.
    The reference to this row within the table.
    Returns the table this row belongs to.
    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

      <T> T get(Column<T> column) throws IllegalArgumentException
      Returns the value for the specified column.
      Type Parameters:
      T - The value type of the column.
      Parameters:
      column - The column, not allowed to be null. The column must be a column contained in the column array returned by the getColumns() method.
      Returns:
      The value of this row for the specified column.
      Throws:
      IllegalArgumentException - If column is null or if the row has no value for the specified column.
    • get

      Object get(int index) throws IndexOutOfBoundsException
      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 the getColumns() 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

      Iterator<Object> iterator()
      Returns an iterator over the values of this row in proper sequence.
      Specified by:
      iterator in interface Iterable<Object>
      Returns:
      The iterator over the values of this row, never null.