Package app.babylon.table.column
Class ColumnCategorical.Renamed<T>
java.lang.Object
app.babylon.table.column.ColumnCategorical.Renamed<T>
- All Implemented Interfaces:
Column,ColumnCategorical<T>,ColumnObject<T>
- Enclosing interface:
ColumnCategorical<T>
public static final class ColumnCategorical.Renamed<T>
extends Object
implements ColumnCategorical<T>
-
Nested Class Summary
Nested classes/interfaces inherited from interface app.babylon.table.column.Column
Column.KeyedValue, Column.Operator, Column.TypeNested classes/interfaces inherited from interface app.babylon.table.column.ColumnCategorical
ColumnCategorical.Builder<T>, ColumnCategorical.Renamed<T>Nested classes/interfaces inherited from interface app.babylon.table.column.ColumnObject
ColumnObject.KeyedObject<T>, ColumnObject.Mode -
Method Summary
Modifier and TypeMethodDescriptionintcompare(int i, int j) Compares two row values from this column using the column's ordering semantics.get(int i) Returns the value at the supplied row.Appends the distinct categorical values to the supplied collection.intgetCategoryCode(int i) Returns the dictionary code stored at the supplied row.int[]getCategoryCodes(int[] x) Returns the distinct category codes used by set values in the column.getCategoryValue(int categoryCode) Resolves a dictionary code to its categorical value.getName()Returns the logical column name.getType()Returns the declared type of values stored in this column.booleanisAllSet()Indicates whether every row in the column contains a value.booleanIndicates 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.booleanIndicates whether no row in the column contains a value.booleanisSet(int i) Indicates whether the value at the supplied row is present.selectRow(int i) Returns a single-row object column containing the value from the supplied row.intsize()Returns the number of rows in the column.<S> ColumnCategorical<S> transform(Transformer<T, S> transformer) Transforms this categorical column into another categorical column.Returns a projected view of this column using the supplied row mapping.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface app.babylon.table.column.ColumnCategorical
copy, copy, getUniques, max, min, select, toStringMethods inherited from interface app.babylon.table.column.ColumnObject
appendTo, first, firstKeyed, getAll, getKeyedValue, last, lastKeyed, predicate, predicate, toString
-
Method Details
-
getName
Description copied from interface:ColumnReturns the logical column name. -
getType
Description copied from interface:ColumnReturns the declared type of values stored in this column. -
size
public int size()Description copied from interface:ColumnReturns the number of rows in the column. -
get
Description copied from interface:ColumnObjectReturns the value at the supplied row.- Specified by:
getin interfaceColumnCategorical<T>- Specified by:
getin interfaceColumnObject<T>- Parameters:
i- the zero-based row index- Returns:
- the row value, or
nullwhen unset
-
isSet
public boolean isSet(int i) Description copied from interface:ColumnIndicates whether the value at the supplied row is present.- Specified by:
isSetin interfaceColumn- Specified by:
isSetin interfaceColumnObject<T>- Parameters:
i- the zero-based row index- Returns:
truewhen the row contains a value
-
getCategoryCode
public int getCategoryCode(int i) Description copied from interface:ColumnCategoricalReturns the dictionary code stored at the supplied row.- Specified by:
getCategoryCodein interfaceColumnCategorical<T>- Parameters:
i- the zero-based row index- Returns:
- the category code for the row
-
getCategoryValue
Description copied from interface:ColumnCategoricalResolves a dictionary code to its categorical value.- Specified by:
getCategoryValuein interfaceColumnCategorical<T>- Parameters:
categoryCode- the dictionary code- Returns:
- the value for that code, or
nullfor the null category
-
getCategoryCodes
public int[] getCategoryCodes(int[] x) Description copied from interface:ColumnCategoricalReturns the distinct category codes used by set values in the column. The null/unset category uses the internal code0, but that code is not exposed by this method. Only codes associated with non-null categorical values are returned.- Specified by:
getCategoryCodesin interfaceColumnCategorical<T>- Parameters:
x- the destination array, ornull- Returns:
- an array of non-zero category codes for set values
-
getCategoricalValues
Description copied from interface:ColumnCategoricalAppends the distinct categorical values to the supplied collection.- Specified by:
getCategoricalValuesin interfaceColumnCategorical<T>- Parameters:
x- the destination collection, ornull- Returns:
- a collection containing the categorical values
-
isConstant
public boolean isConstant()Description copied from interface:ColumnIndicates 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.- Specified by:
isConstantin interfaceColumn- Returns:
truewhen the column is constant
-
isAllSet
public boolean isAllSet()Description copied from interface:ColumnIndicates whether every row in the column contains a value. -
isNoneSet
public boolean isNoneSet()Description copied from interface:ColumnIndicates whether no row in the column contains a value. -
compare
public int compare(int i, int j) Description copied from interface:ColumnCompares two row values from this column using the column's ordering semantics.- Specified by:
comparein interfaceColumn- Specified by:
comparein interfaceColumnCategorical<T>- Parameters:
i- the first row indexj- 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
Description copied from interface:ColumnReturns a projected view of this column using the supplied row mapping.- Specified by:
viewin interfaceColumn- Specified by:
viewin interfaceColumnCategorical<T>- Specified by:
viewin interfaceColumnObject<T>- Parameters:
rowIndex- the row mapping to apply- Returns:
- a column view over the selected rows
-
selectRow
Description copied from interface:ColumnObjectReturns a single-row object column containing the value from the supplied row.- Specified by:
selectRowin interfaceColumn- Specified by:
selectRowin interfaceColumnCategorical<T>- Specified by:
selectRowin interfaceColumnObject<T>- Parameters:
i- the row to extract- Returns:
- a single-row object column with the same column name
-
transform
Description copied from interface:ColumnCategoricalTransforms this categorical column into another categorical column.- Specified by:
transformin interfaceColumnCategorical<T>- Specified by:
transformin interfaceColumnObject<T>- Type Parameters:
S- the transformed value type- Parameters:
transformer- the transformation to apply- Returns:
- the transformed categorical column
-