Package app.babylon.table.column
Interface ColumnObject<T>
- Type Parameters:
T- the runtime value type stored in the column
- All Superinterfaces:
Column
- All Known Subinterfaces:
ColumnCategorical<T>
A column that stores object values, including strings, dates, decimals, and
other reference types.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceBuilder for nullable object columns.static enumControls which physical representation should back an object column.Nested classes/interfaces inherited from interface app.babylon.table.column.Column
Column.Type -
Method Summary
Modifier and TypeMethodDescriptionstatic ColumnObject.Builder<String> builder(ColumnName name) Creates aStringcolumn builder.static <T> ColumnObject.Builder<T> builder(ColumnName name, Column.Type type) Creates an object column builder using the default storage mode.static <T> ColumnObject.Builder<T> builder(ColumnName name, Column.Type type, ColumnObject.Mode mode) Creates an object column builder using the requested storage mode.static ColumnObject.Builder<BigDecimal> builderDecimal(ColumnName name) Creates aBigDecimalcolumn builder.static <T> booleanequals(ColumnObject<T> a, Object obj) Compares a column object with another object using column name, size, and row-by-row value equality.default Tfirst()Returns the first row value.get(int i) Returns the value at the supplied row.default Collection<T> getAll(Collection<T> x) Appends all set values to the supplied collection.getUniques(Set<T> x) Collects the distinct set values from the column.booleanIndicates whether the column represents the same value for every row.default booleanisSet(int i) Indicates whether the value at the supplied row is present.default Tlast()Returns the last row value.default Tmax()default Tmin()default SelectionSelects rows whose values satisfy the supplied predicate.default StringtoString(int i, ToStringSettings settings) Formats the value at the supplied row using the provided rendering settings.default <S> ColumnObject<S> transform(Transformer<T, S> transformer) Transforms this column into another object column using the supplied transformer.Returns a projected view of this column using the supplied row mapping.
-
Method Details
-
builder
Creates an object column builder using the default storage mode.- Type Parameters:
T- the value type- Parameters:
name- the column nametype- 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 nametype- the column typemode- the preferred storage strategy- Returns:
- a builder for the supplied object type
-
builderDecimal
Creates aBigDecimalcolumn builder.- Parameters:
name- the column name- Returns:
- a decimal column builder
-
builder
Creates aStringcolumn builder.- Parameters:
name- the column name- Returns:
- a string column builder
-
view
Description copied from interface:ColumnReturns a projected view of this column using the supplied row mapping. -
get
Returns the value at the supplied row.- Parameters:
i- the zero-based row index- Returns:
- the row value, or
nullwhen unset
-
isConstant
boolean isConstant()Indicates whether the column represents the same value for every row.- Returns:
truewhen the column is constant
-
isSet
default boolean isSet(int i) Description copied from interface:ColumnIndicates whether the value at the supplied row is present. -
first
Returns the first row value.- Returns:
- the first row value
-
last
Returns the last row value.- Returns:
- the last row value
-
max
-
min
-
getAll
Appends all set values to the supplied collection.- Parameters:
x- the destination collection, ornull- Returns:
- a collection containing all set values in row order
-
getUniques
Collects the distinct set values from the column.- Parameters:
x- the destination set, ornull- Returns:
- a set containing the unique values
-
select
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
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
Description copied from interface:ColumnFormats the value at the supplied row using the provided rendering settings. -
equals
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 compareobj- the comparison target- Returns:
truewhen the objects represent the same column contents
-