Interface Column

All Known Subinterfaces:
ColumnBoolean, ColumnByte, ColumnCategorical<T>, ColumnDouble, ColumnInt, ColumnLong, ColumnObject<T>
All Known Implementing Classes:
ColumnBoolean.Renamed, ColumnByte.Renamed, ColumnCategorical.Renamed, ColumnDouble.Renamed, ColumnInt.Renamed, ColumnLong.Renamed, ColumnObject.Renamed

public interface Column
Base contract for a named column of tabular data, including size, null-state, comparison, projection, and row-level access operations.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Builds an immutable column instance for a specific column name.
    static enum 
     
    static interface 
    Describes the runtime value type stored by a column.
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    allRowsMatch(Column column, RowPredicate include)
     
    default void
    appendTo(int i, StringBuilder out, ToStringSettings settings)
    Appends the value at the supplied row using the provided rendering settings.
    int
    compare(int i, int j)
    Compares two row values from this column using the column's ordering semantics.
    Creates a copy of this column with the supplied column name.
    Creates a copy of this column with the supplied column name, only retaining rows included by the supplied row predicate.
    default long
    Returns the number of rows that contain a value.
    Returns the logical column name.
    Returns the declared type of values stored in this column.
    boolean
    Indicates whether every row in the column contains a value.
    boolean
    Indicates whether the column represents the same value for every row.Unset values are part of the value pattern, so an all-unset column is constant, while a mix of unset and set values is not constant unless the implementation explicitly defines that pattern as constant.
    default boolean
    Indicates whether the column has no set values, either because it has no rows or because every row is unset.
    boolean
    Indicates whether no row in the column contains a value.
    boolean
    isSet(int i)
    Indicates whether the value at the supplied row is present.
    predicate(Column.Operator operator, CharSequence... values)
    Creates a row predicate by parsing the supplied comparison values according to this column's type.
    default RowPredicate
     
    selectRow(int i)
    Returns a single-row column containing the value from the supplied row.
    int
    Returns the number of rows in the column.
    toString(int i)
    Formats the value at the supplied row for display.
    default String
    toString(int i, ToStringSettings settings)
    Formats the value at the supplied row using the provided rendering settings.
    view(ViewIndex rowIndex)
    Returns a projected view of this column using the supplied row mapping.
  • Method Details

    • getType

      Column.Type getType()
      Returns the declared type of values stored in this column.
      Returns:
      the column value type
    • size

      int size()
      Returns the number of rows in the column.
      Returns:
      the row count
    • getName

      ColumnName getName()
      Returns the logical column name.
      Returns:
      the column name
    • isSet

      boolean isSet(int i)
      Indicates whether the value at the supplied row is present.
      Parameters:
      i - the zero-based row index
      Returns:
      true when the row contains a value
    • isAllSet

      boolean isAllSet()
      Indicates whether every row in the column contains a value.
      Returns:
      true when all rows are set
    • isNoneSet

      boolean isNoneSet()
      Indicates whether no row in the column contains a value.
      Returns:
      true when every row is unset
    • count

      default long count()
      Returns the number of rows that contain a value.
      Returns:
      count of set rows
    • isEmpty

      default boolean isEmpty()
      Indicates whether the column has no set values, either because it has no rows or because every row is unset.
      Returns:
      true when the column is effectively empty
    • isConstant

      boolean isConstant()
      Indicates whether the column represents the same value for every row.Unset values are part of the value pattern, so an all-unset column is constant, while a mix of unset and set values is not constant unless the implementation explicitly defines that pattern as constant.
      Returns:
      true when the column is constant
    • toString

      String toString(int i)
      Formats the value at the supplied row for display.
      Parameters:
      i - the zero-based row index
      Returns:
      the formatted row value, or an empty string when unset
    • toString

      default String toString(int i, ToStringSettings settings)
      Formats the value at the supplied row using the provided rendering settings.
      Parameters:
      i - the zero-based row index
      settings - formatting settings to apply
      Returns:
      the formatted row value
    • appendTo

      default void appendTo(int i, StringBuilder out, ToStringSettings settings)
      Appends the value at the supplied row using the provided rendering settings.
      Parameters:
      i - the zero-based row index
      out - the destination buffer
      settings - formatting settings to apply
    • compare

      int compare(int i, int j)
      Compares two row values from this column using the column's ordering semantics.
      Parameters:
      i - the first row index
      j - the second row index
      Returns:
      a negative number, zero, or a positive number as the first row is less than, equal to, or greater than the second
    • view

      Column view(ViewIndex rowIndex)
      Returns a projected view of this column using the supplied row mapping.
      Parameters:
      rowIndex - the row mapping to apply
      Returns:
      a column view over the selected rows
    • copy

      Column copy(ColumnName x)
      Creates a copy of this column with the supplied column name.
      Parameters:
      x - the name to assign to the copy
      Returns:
      a column containing the same values under the new name
    • copy

      Column copy(ColumnName x, RowPredicate include)
      Creates a copy of this column with the supplied column name, only retaining rows included by the supplied row predicate.
      Parameters:
      x - the name to assign to the copy
      include - row predicate indicating which source rows to copy
      Returns:
      a column containing copied values for included rows and unset values elsewhere
    • selectRow

      Column selectRow(int i)
      Returns a single-row column containing the value from the supplied row.
      Parameters:
      i - the row to extract
      Returns:
      a single-row column with the same column name
    • predicate

      RowPredicate predicate(Column.Operator operator, CharSequence... values)
      Creates a row predicate by parsing the supplied comparison values according to this column's type.
      Parameters:
      operator - comparison operator
      values - comparison values as text
      Returns:
      predicate evaluated by row index
    • allRowsMatch

      static boolean allRowsMatch(Column column, RowPredicate include)
    • predicate

      default RowPredicate predicate(ComparisonCondition condition)