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>
  • Method Details

    • getName

      public ColumnName getName()
      Description copied from interface: Column
      Returns the logical column name.
      Specified by:
      getName in interface Column
      Returns:
      the column name
    • getType

      public Column.Type getType()
      Description copied from interface: Column
      Returns the declared type of values stored in this column.
      Specified by:
      getType in interface Column
      Returns:
      the column value type
    • size

      public int size()
      Description copied from interface: Column
      Returns the number of rows in the column.
      Specified by:
      size in interface Column
      Returns:
      the row count
    • get

      public T get(int i)
      Description copied from interface: ColumnObject
      Returns the value at the supplied row.
      Specified by:
      get in interface ColumnCategorical<T>
      Specified by:
      get in interface ColumnObject<T>
      Parameters:
      i - the zero-based row index
      Returns:
      the row value, or null when unset
    • isSet

      public 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
      Specified by:
      isSet in interface ColumnObject<T>
      Parameters:
      i - the zero-based row index
      Returns:
      true when the row contains a value
    • getCategoryCode

      public int getCategoryCode(int i)
      Description copied from interface: ColumnCategorical
      Returns the dictionary code stored at the supplied row.
      Specified by:
      getCategoryCode in interface ColumnCategorical<T>
      Parameters:
      i - the zero-based row index
      Returns:
      the category code for the row
    • getCategoryValue

      public T getCategoryValue(int categoryCode)
      Description copied from interface: ColumnCategorical
      Resolves a dictionary code to its categorical value.
      Specified by:
      getCategoryValue in interface ColumnCategorical<T>
      Parameters:
      categoryCode - the dictionary code
      Returns:
      the value for that code, or null for the null category
    • getCategoryCodes

      public int[] getCategoryCodes(int[] x)
      Description copied from interface: ColumnCategorical
      Returns the distinct category codes used by set values in the column. The null/unset category uses the internal code 0, but that code is not exposed by this method. Only codes associated with non-null categorical values are returned.
      Specified by:
      getCategoryCodes in interface ColumnCategorical<T>
      Parameters:
      x - the destination array, or null
      Returns:
      an array of non-zero category codes for set values
    • getCategoricalValues

      public Collection<T> getCategoricalValues(Collection<T> x)
      Description copied from interface: ColumnCategorical
      Appends the distinct categorical values to the supplied collection.
      Specified by:
      getCategoricalValues in interface ColumnCategorical<T>
      Parameters:
      x - the destination collection, or null
      Returns:
      a collection containing the categorical values
    • isConstant

      public boolean isConstant()
      Description copied from interface: Column
      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.
      Specified by:
      isConstant in interface Column
      Returns:
      true when the column is constant
    • isAllSet

      public boolean isAllSet()
      Description copied from interface: Column
      Indicates whether every row in the column contains a value.
      Specified by:
      isAllSet in interface Column
      Returns:
      true when all rows are set
    • isNoneSet

      public boolean isNoneSet()
      Description copied from interface: Column
      Indicates whether no row in the column contains a value.
      Specified by:
      isNoneSet in interface Column
      Returns:
      true when every row is unset
    • compare

      public int compare(int i, int j)
      Description copied from interface: Column
      Compares two row values from this column using the column's ordering semantics.
      Specified by:
      compare in interface Column
      Specified by:
      compare in interface ColumnCategorical<T>
      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

      public ColumnCategorical<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
      Specified by:
      view in interface ColumnCategorical<T>
      Specified by:
      view in interface ColumnObject<T>
      Parameters:
      rowIndex - the row mapping to apply
      Returns:
      a column view over the selected rows
    • selectRow

      public ColumnCategorical<T> selectRow(int i)
      Description copied from interface: ColumnObject
      Returns a single-row object column containing the value from the supplied row.
      Specified by:
      selectRow in interface Column
      Specified by:
      selectRow in interface ColumnCategorical<T>
      Specified by:
      selectRow in interface ColumnObject<T>
      Parameters:
      i - the row to extract
      Returns:
      a single-row object column with the same column name
    • transform

      public <S> ColumnCategorical<S> transform(Transformer<T,S> transformer)
      Description copied from interface: ColumnCategorical
      Transforms this categorical column into another categorical column.
      Specified by:
      transform in interface ColumnCategorical<T>
      Specified by:
      transform in interface ColumnObject<T>
      Type Parameters:
      S - the transformed value type
      Parameters:
      transformer - the transformation to apply
      Returns:
      the transformed categorical column