Interface ColumnObject<T>

Type Parameters:
T - the runtime value type stored in the column
All Superinterfaces:
Column
All Known Subinterfaces:
ColumnCategorical<T>

public interface ColumnObject<T> extends Column
A column that stores object values, including strings, dates, decimals, and other reference types.
  • Method Details

    • builder

      static <T> ColumnObject.Builder<T> builder(ColumnName name, Column.Type type)
      Creates an object column builder using the default storage mode.
      Type Parameters:
      T - the value type
      Parameters:
      name - the column name
      type - the column type
      Returns:
      a builder for the supplied object type
    • builder

      static <T> ColumnObject.Builder<T> builder(ColumnName name, Column.Type type, ColumnObject.Mode mode)
      Creates an object column builder using the requested storage mode.
      Type Parameters:
      T - the value type
      Parameters:
      name - the column name
      type - the column type
      mode - the preferred storage strategy
      Returns:
      a builder for the supplied object type
    • builderDecimal

      static ColumnObject.Builder<BigDecimal> builderDecimal(ColumnName name)
      Creates a BigDecimal column builder.
      Parameters:
      name - the column name
      Returns:
      a decimal column builder
    • builder

      static ColumnObject.Builder<String> builder(ColumnName name)
      Creates a String column builder.
      Parameters:
      name - the column name
      Returns:
      a string column builder
    • view

      ColumnObject<T> view(ViewIndex rowIndex)
      Description copied from interface: Column
      Returns a projected view of this column using the supplied row mapping.
      Specified by:
      view in interface Column
      Parameters:
      rowIndex - the row mapping to apply
      Returns:
      a column view over the selected rows
    • get

      T get(int i)
      Returns the value at the supplied row.
      Parameters:
      i - the zero-based row index
      Returns:
      the row value, or null when unset
    • isConstant

      boolean isConstant()
      Indicates whether the column represents the same value for every row.
      Returns:
      true when the column is constant
    • isSet

      default boolean isSet(int i)
      Description copied from interface: Column
      Indicates whether the value at the supplied row is present.
      Specified by:
      isSet in interface Column
      Parameters:
      i - the zero-based row index
      Returns:
      true when the row contains a value
    • first

      default T first()
      Returns the first row value.
      Returns:
      the first row value
    • last

      default T last()
      Returns the last row value.
      Returns:
      the last row value
    • getAll

      default Collection<T> getAll(Collection<T> x)
      Appends all set values to the supplied collection.
      Parameters:
      x - the destination collection, or null
      Returns:
      a collection containing all set values in row order
    • getUniques

      default Set<T> getUniques(Set<T> x)
      Collects the distinct set values from the column.
      Parameters:
      x - the destination set, or null
      Returns:
      a set containing the unique values
    • select

      default Selection select(Predicate<T> f)
      Selects rows whose values satisfy the supplied predicate.
      Parameters:
      f - the predicate to test against each set value
      Returns:
      a selection containing the predicate result for each row
    • transform

      default <S> ColumnObject<S> transform(Transformer<T,S> transformer)
      Transforms this column into another object column using the supplied transformer.
      Type Parameters:
      S - the transformed value type
      Parameters:
      transformer - the row transformation to apply
      Returns:
      a transformed column
    • toString

      default String toString(int i, ToStringSettings settings)
      Description copied from interface: Column
      Formats the value at the supplied row using the provided rendering settings.
      Specified by:
      toString in interface Column
      Parameters:
      i - the zero-based row index
      settings - formatting settings to apply
      Returns:
      the formatted row value
    • equals

      static <T> boolean equals(ColumnObject<T> a, Object obj)
      Compares a column object with another object using column name, size, and row-by-row value equality.
      Type Parameters:
      T - the column value type
      Parameters:
      a - the column to compare
      obj - the comparison target
      Returns:
      true when the objects represent the same column contents