Class RedefinableTable<IMPL_TYPE extends RedefinableTable<IMPL_TYPE>>

All Implemented Interfaces:
TableOperations<Table,Table>, TableOperationsDefaults<Table,Table>, LogOutputAppendable, LivenessManager, LivenessNode, LivenessReferent, AttributeMap<Table>, GridAttributes<Table>, HasParentPerformanceIds, NotificationStepReceiver, NotificationStepSource, TableDefaults, Table, DynamicNode, NotificationQueue.Dependency, SystemicObject<Table>, LongSizedDataStructure, Serializable
Direct Known Subclasses:
DeferredViewTable, SourceTable

public abstract class RedefinableTable<IMPL_TYPE extends RedefinableTable<IMPL_TYPE>> extends UncoalescedTableImpl<IMPL_TYPE>
An uncoalesced table that may be redefined without triggering a UncoalescedTableImpl.coalesce().
See Also:
  • Constructor Details

    • RedefinableTable

      protected RedefinableTable(@NotNull @NotNull TableDefinition definition, @NotNull @NotNull String description, @Nullable @Nullable Map<String,Object> attributes)
      Parameters:
      definition - The definition for this table
      description - A description of this table
      attributes - The attributes map to use, or else null to allocate a new one
  • Method Details

    • view

      public Table view(Collection<? extends Selectable> selectables)
      Specified by:
      view in interface TableOperations<Table,Table>
      Overrides:
      view in class UncoalescedTable<IMPL_TYPE extends RedefinableTable<IMPL_TYPE>>
    • updateView

      public Table updateView(Collection<? extends Selectable> selectables)
      Specified by:
      updateView in interface TableOperations<Table,Table>
      Overrides:
      updateView in class UncoalescedTable<IMPL_TYPE extends RedefinableTable<IMPL_TYPE>>
    • dropColumns

      public Table dropColumns(String... columnNames)
      Description copied from interface: TableOperations
      Creates a new table without the columnNames from this.
      Specified by:
      dropColumns in interface TableOperations<Table,Table>
      Overrides:
      dropColumns in class UncoalescedTable<IMPL_TYPE extends RedefinableTable<IMPL_TYPE>>
      Parameters:
      columnNames - the columns to drop
      Returns:
      the table
    • renameColumns

      public Table renameColumns(Collection<Pair> pairs)
      Description copied from interface: Table
      Produce a new table with the specified columns renamed using the specified pairs. The renames are simultaneous and unordered, enabling direct swaps between column names. The resulting table retains the original column ordering after applying the specified renames.

      NOTE: If a new column name matches an existing column that is not itself renamed, that existing column is silently dropped from the result. When the existing column is also renamed (a swap), nothing is dropped.

      IllegalArgumentException will be thrown:

      • if a source column does not exist
      • if a source column is used more than once
      • if a destination column is used more than once
      Specified by:
      renameColumns in interface Table
      Overrides:
      renameColumns in class UncoalescedTable<IMPL_TYPE extends RedefinableTable<IMPL_TYPE>>
      Parameters:
      pairs - The columns to rename
      Returns:
      The new table, with the columns renamed
    • redefine

      protected final BaseTable<?> redefine(TableDefinition newDefinition)
      Redefine this table with a subset of its current columns. If newDefinition has the same column names in the same order as this table, LiveAttributeMap.prepareReturnThis() will be returned. Delegates to redefineImpl(TableDefinition) otherwise.
      Parameters:
      newDefinition - A TableDefinition with a subset of this RedefinableTable's ColumnDefinitions.
      Returns:
      the redefined table
    • redefineImpl

      protected abstract BaseTable<?> redefineImpl(TableDefinition newDefinition)
      Redefine this table with a proper-subset, or re-ordering, of its current columns.
      Parameters:
      newDefinition - A TableDefinition with a proper-subset of this RedefinableTable's ColumnDefinitions.
      Returns:
      the redefined table
    • redefine

      protected abstract Table redefine(TableDefinition newDefinitionExternal, TableDefinition newDefinitionInternal, SelectColumn[] viewColumns)
      Redefine this table with a subset of its current columns, with a potentially-differing definition to present to external interfaces and one or more select columns to apply.
      Parameters:
      newDefinitionExternal - A TableDefinition that represents the results of redefine(newDefinitionInternal).view(viewColumns).
      newDefinitionInternal - A TableDefinition with a subset of this RedefinableTable's ColumnDefinitions.
      viewColumns - A set of SelectColumns to apply in order to transform a table with newDefinitionInternal to a table with newDefinitionExternal. Each column may read the result of an earlier column, as in TableOperations.view(Collection).
      Returns:
      the redefined table
    • redefineWithRename

      protected abstract Table redefineWithRename(TableDefinition newDefinitionExternal, SourceColumn[] renameColumns)
      Redefine this table by renaming the table's columns. Unlike the view columns of redefine(TableDefinition, TableDefinition, SelectColumn[]), which apply in order, the rename columns apply simultaneously, as Table.renameColumns(Collection) requires: every rename column reads a column of this table, never the result of another rename column. Applied in order, a swap would read a column that the swap had already replaced.
      Parameters:
      newDefinitionExternal - A TableDefinition that represents the result of the rename.
      renameColumns - One SourceColumn per column of newDefinitionExternal, in the same order, each naming a column of this table to read.
      Returns:
      the renamed table