Interface TableDefaults

All Superinterfaces:
AttributeMap<Table>, DynamicNode, GridAttributes<Table>, LivenessManager, LivenessNode, LivenessReferent, LogOutputAppendable, LongSizedDataStructure, NotificationQueue.Dependency, SystemicObject<Table>, Table, TableOperations<Table,Table>, TableOperationsDefaults<Table,Table>
All Known Subinterfaces:
TableAdapter
All Known Implementing Classes:
AppendOnlyArrayBackedInputTable, BarrageBlinkTable, BarrageRedirectedTable, BarrageTable, BaseTable, DeferredViewTable, InitialSnapshotTable, InMemoryTable, KeyedArrayBackedInputTable, PartitionAwareSourceTable, QueryReplayGroupedTable, QueryTable, QueryTable.FilteredTable, RedefinableTable, ReplayGroupedFullTable, ReplayLastByGroupedTable, ReplayTable, ReplayTableBase, SimpleSourceTable, SourceTable, TimeTable, UncoalescedTable, UpdatableTable, UpdateSourceQueryTable

public interface TableDefaults extends Table, TableOperationsDefaults<Table,Table>
Sub-interface to capture default methods rom Table.
  • Field Details

    • ZERO_LENGTH_TABLE_ARRAY

      static final Table[] ZERO_LENGTH_TABLE_ARRAY
  • Method Details

    • coalesce

      default Table coalesce()
      Description copied from interface: Table
      Explicitly ensure that any work needed to make a table addressable, iterable, or queryable has been done, and return the coalesced child table if appropriate.
      Specified by:
      coalesce in interface Table
      Returns:
      This table, or a fully-coalesced child
    • meta

      Description copied from interface: Table
      Provides column metadata in Table form.
      Specified by:
      meta in interface Table
      Returns:
      A Table of metadata about this Table's columns.
    • numColumns

      @ConcurrentMethod @FinalDefault default int numColumns()
      Description copied from interface: Table
      Get the number of columns defined for this table. Equivalent to getDefinition().getColumns().length.
      Specified by:
      numColumns in interface Table
      Returns:
      The number of columns defined for this table
    • hasColumns

      @ConcurrentMethod @FinalDefault default boolean hasColumns(String... columnNames)
      Description copied from interface: Table
      Determines whether this Table contains a column for each string in the specified array of columnNames.
      Specified by:
      hasColumns in interface Table
      Parameters:
      columnNames - The array of column names to be checked for inclusion in this table. Must not be null.
      Returns:
      true if this Table contains a column for each and every string in the columnNames array; false if any element of columnNames is not the name of a column in this table
    • hasColumns

      @ConcurrentMethod @FinalDefault default boolean hasColumns(Collection<String> columnNames)
      Description copied from interface: Table
      Determines whether this Table contains a column for each string in the specified collection of columnNames.
      Specified by:
      hasColumns in interface Table
      Parameters:
      columnNames - The collection of column names to be checked for inclusion in this table. Must not be null.
      Returns:
      true if this Table contains a column for each and every string in the columnNames collection; false if any element of columnNames is not the name of a column in this table
    • sizeForInstrumentation

      default long sizeForInstrumentation()
      Specified by:
      sizeForInstrumentation in interface Table
      Returns:
      Size if it is currently known without subsequent steps to coalesce the Table, else null
    • isEmpty

      @FinalDefault default boolean isEmpty()
      Description copied from interface: Table
      Returns true if this table has no rows (i.e. size() == 0).
      Specified by:
      isEmpty in interface Table
      Returns:
      true if this table has no rows
    • getColumnSource

      @FinalDefault default <T> ColumnSource<T> getColumnSource(String sourceName, Class<? extends T> clazz)
      Description copied from interface: Table
      Retrieves a ColumnSource and casts it to the target class clazz.

      The success of this call is equivalent to getDefinition().checkColumn(sourceName, clazz), which is the preferred way to check for compatibility in scenarios where the caller does not want to the implementation to potentially invoke Table.coalesce().

      Specified by:
      getColumnSource in interface Table
      Type Parameters:
      T - The target type, as a type parameter. Intended to be inferred from clazz.
      Parameters:
      sourceName - The name of the column
      clazz - The target type
      Returns:
      The column source for sourceName, parameterized by T
      See Also:
    • getColumnSource

      @FinalDefault default <T> ColumnSource<T> getColumnSource(String sourceName, Class<? extends T> clazz, @Nullable Class<?> componentType)
      Description copied from interface: Table
      Retrieves a ColumnSource and ColumnSource.cast(Class, Class) casts} it to the target class clazz and componentType.

      The success of this call is equivalent to getDefinition().checkColumn(sourceName, clazz, componentType), which is the preferred way to check for compatibility in scenarios where the caller does not want the implementation to potentially invoke Table.coalesce().

      Specified by:
      getColumnSource in interface Table
      Type Parameters:
      T - The target type, as a type parameter. Intended to be inferred from clazz.
      Parameters:
      sourceName - The name of the column
      clazz - The target type
      componentType - The target component type, may be null
      Returns:
      The column source for sourceName, parameterized by T
      See Also:
    • wouldMatch

      @ConcurrentMethod @FinalDefault default Table wouldMatch(String... expressions)
      Specified by:
      wouldMatch in interface Table
    • selectDistinct

      @ConcurrentMethod @FinalDefault default Table selectDistinct()
      Specified by:
      selectDistinct in interface TableOperations<Table,Table>
    • dropColumnFormats

      @ConcurrentMethod @FinalDefault default Table dropColumnFormats()
      Specified by:
      dropColumnFormats in interface Table
    • renameColumns

      @FinalDefault default Table renameColumns(String... pairs)
      Description copied from interface: Table
      Produce a new table with the specified columns renamed using the syntax "NewColumnName=OldColumnName". 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.

      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
      Parameters:
      pairs - The columns to rename
      Returns:
      The new table, with the columns renamed
    • renameAllColumns

      @FinalDefault default Table renameAllColumns(UnaryOperator<String> renameFunction)
      Description copied from interface: Table
      Produce a new table with the specified columns renamed using the provided function. 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.

      IllegalArgumentException will be thrown:

      • if a destination column is used more than once
      Specified by:
      renameAllColumns in interface Table
      Parameters:
      renameFunction - The function to apply to each column name
      Returns:
      The new table, with the columns renamed
    • formatRowWhere

      @ConcurrentMethod @FinalDefault default Table formatRowWhere(String condition, String formula)
      Specified by:
      formatRowWhere in interface Table
    • formatColumnWhere

      @ConcurrentMethod @FinalDefault default Table formatColumnWhere(String columnName, String condition, String formula)
      Specified by:
      formatColumnWhere in interface Table
    • formatColumns

      @ConcurrentMethod @FinalDefault default Table formatColumns(String... columnFormats)
      Specified by:
      formatColumns in interface Table
    • moveColumnsUp

      @ConcurrentMethod @FinalDefault default Table moveColumnsUp(String... columnsToMove)
      Description copied from interface: Table
      Produce a new table with the specified columns moved to the leftmost position. Columns can be renamed with the usual syntax, i.e. "NewColumnName=OldColumnName"). The renames are simultaneous and unordered, enabling direct swaps between column names. All other columns are left in their original order.

      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:
      moveColumnsUp in interface Table
      Parameters:
      columnsToMove - The columns to move to the left (and, optionally, to rename)
      Returns:
      The new table, with the columns rearranged as explained above
    • moveColumnsDown

      @ConcurrentMethod @FinalDefault default Table moveColumnsDown(String... columnsToMove)
      Description copied from interface: Table
      Produce a new table with the specified columns moved to the rightmost position. Columns can be renamed with the usual syntax, i.e. "NewColumnName=OldColumnName"). The renames are simultaneous and unordered, enabling direct swaps between column names. All other columns are left in their original order.

      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:
      moveColumnsDown in interface Table
      Parameters:
      columnsToMove - The columns to move to the right (and, optionally, to rename)
      Returns:
      The new table, with the columns rearranged as explained above
    • join

      @FinalDefault default Table join(Table rightTable, Collection<? extends JoinMatch> columnsToMatch, Collection<? extends JoinAddition> columnsToAdd)
      Description copied from interface: TableOperations
      Perform a cross join with the rightTable.

      Delegates to TableOperations.join(Object, Collection, Collection, int).

      Specified by:
      join in interface TableOperations<Table,Table>
      Parameters:
      rightTable - The right side table on the join.
      columnsToMatch - The match pair conditions.
      columnsToAdd - The columns from the right side that need to be added to the left side as a result of the match.
      Returns:
      a new table joined according to the specification in columnsToMatch and columnsToAdd
    • headBy

      @FinalDefault default Table headBy(long nRows, Collection<String> groupByColumnNames)
      Specified by:
      headBy in interface Table
    • tailBy

      @FinalDefault default Table tailBy(long nRows, Collection<String> groupByColumnNames)
      Specified by:
      tailBy in interface Table
    • applyToAllBy

      @ConcurrentMethod @FinalDefault default Table applyToAllBy(String formulaColumn, String columnParamName, Collection<? extends ColumnName> groupByColumns)
      Description copied from interface: Table
      Groups data according to groupByColumns and applies formulaColumn to each of columns not altered by the grouping operation. columnParamName is used as place-holder for the name of each column inside formulaColumn.
      Specified by:
      applyToAllBy in interface Table
      Parameters:
      formulaColumn - Formula applied to each column
      columnParamName - The parameter name used as a placeholder for each column
      groupByColumns - The grouping columns as in TableOperations.groupBy(Collection)
    • applyToAllBy

      @ConcurrentMethod @FinalDefault default Table applyToAllBy(String formulaColumn, Collection<? extends ColumnName> groupByColumns)
      Description copied from interface: Table
      Groups data according to groupByColumns and applies formulaColumn to each of columns not altered by the grouping operation.
      Specified by:
      applyToAllBy in interface Table
      Parameters:
      formulaColumn - Formula applied to each column, uses parameter each to refer to each colum it being applied to
      groupByColumns - The grouping columns as in TableOperations.groupBy(Collection)
    • applyToAllBy

      @ConcurrentMethod @FinalDefault default Table applyToAllBy(String formulaColumn, String... groupByColumns)
      Description copied from interface: Table
      Groups data according to groupByColumns and applies formulaColumn to each of columns not altered by the grouping operation.
      Specified by:
      applyToAllBy in interface Table
      Parameters:
      formulaColumn - Formula applied to each column, uses parameter each to refer to each colum it being applied to
      groupByColumns - The grouping columns as in TableOperations.groupBy()
    • partitionBy

      @ConcurrentMethod @FinalDefault default PartitionedTable partitionBy(String... keyColumnNames)
      Description copied from interface: Table
      Equivalent to partitionBy(false, keyColumnNames)

      Create a PartitionedTable from this table, partitioned according to the specified key columns. Key columns are never dropped from the output constituent tables.

      The underlying partitioned table backing the result contains each row in this table in exactly one of the result's constituent tables.

      Specified by:
      partitionBy in interface Table
      Parameters:
      keyColumnNames - The names of the key columns to partition by
      Returns:
      A PartitionedTable keyed by keyColumnNames
    • rollup

      @ConcurrentMethod @FinalDefault default RollupTable rollup(Collection<? extends Aggregation> aggregations)
      Description copied from interface: Table
      Create a rollup table.

      A rollup table aggregates all rows of the table.

      Specified by:
      rollup in interface Table
      Parameters:
      aggregations - The aggregations to perform
      Returns:
      a hierarchical table with the rollup applied
    • rollup

      @ConcurrentMethod @FinalDefault default RollupTable rollup(Collection<? extends Aggregation> aggregations, boolean includeConstituents)
      Description copied from interface: Table
      Create a rollup table.

      A rollup table aggregates all rows of the table.

      Specified by:
      rollup in interface Table
      Parameters:
      aggregations - The aggregations to perform
      includeConstituents - set to true to include the constituent rows at the leaf level
      Returns:
      a hierarchical table with the rollup applied
    • rollup

      @ConcurrentMethod @FinalDefault default RollupTable rollup(Collection<? extends Aggregation> aggregations, String... groupByColumns)
      Description copied from interface: Table
      Create a rollup table.

      A rollup table aggregates by the specified columns, and then creates a hierarchical table which re-aggregates using one less aggregation column on each level. The column that is no longer part of the aggregation key is replaced with null on each level.

      Specified by:
      rollup in interface Table
      Parameters:
      aggregations - The aggregations to perform
      groupByColumns - the columns to group by
      Returns:
      a hierarchical table with the rollup applied
    • rollup

      @ConcurrentMethod @FinalDefault default RollupTable rollup(Collection<? extends Aggregation> aggregations, boolean includeConstituents, String... groupByColumns)
      Description copied from interface: Table
      Create a rollup table.

      A rollup table aggregates by the specified columns, and then creates a hierarchical table which re-aggregates using one less aggregation column on each level. The column that is no longer part of the aggregation key is replaced with null on each level.

      Specified by:
      rollup in interface Table
      Parameters:
      aggregations - The aggregations to perform
      includeConstituents - set to true to include the constituent rows at the leaf level
      groupByColumns - the columns to group by
      Returns:
      a hierarchical table with the rollup applied
    • rollup

      @ConcurrentMethod @FinalDefault default RollupTable rollup(Collection<? extends Aggregation> aggregations, Collection<? extends ColumnName> groupByColumns)
      Description copied from interface: Table
      Create a rollup table.

      A rollup table aggregates by the specified columns, and then creates a hierarchical table which re-aggregates using one less aggregation column on each level. The column that is no longer part of the aggregation key is replaced with null on each level.

      Specified by:
      rollup in interface Table
      Parameters:
      aggregations - The aggregations to perform
      groupByColumns - the columns to group by
      Returns:
      a hierarchical table with the rollup applied
    • snapshotWhen

      @FinalDefault default Table snapshotWhen(Table trigger, SnapshotWhenOptions.Flag... features)
      Description copied from interface: TableOperations
      Creates a table that captures a snapshot of this whenever trigger updates.

      Equivalent to snapshotWhen(trigger, SnapshotWhenControl.of(features)).

      Specified by:
      snapshotWhen in interface TableOperations<Table,Table>
      Parameters:
      trigger - the trigger table
      features - the snapshot features
      Returns:
      the snapshotting table
      See Also:
    • snapshotWhen

      @FinalDefault default Table snapshotWhen(Table trigger, Collection<SnapshotWhenOptions.Flag> features, String... stampColumns)
      Description copied from interface: TableOperations
      Creates a table that captures a snapshot of this whenever trigger updates.

      Equivalent to snapshotWhen(trigger, SnapshotWhenControl.of(features, stampColumns)).

      See SnapshotWhenOptions for details on the stampColumns.

      Specified by:
      snapshotWhen in interface TableOperations<Table,Table>
      Parameters:
      trigger - the trigger table
      features - the snapshot features
      stampColumns - the stamp columns
      Returns:
      the snapshotting table
      See Also:
    • close

      @FinalDefault default void close()
      Description copied from interface: Table
      Release resources held by this table, possibly destructively. This may render the table unsuitable or unsafe for further use.
      Specified by:
      close in interface Table
    • releaseCachedResources

      default void releaseCachedResources()
      Description copied from interface: Table
      Attempt to release cached resources held by this table. Unlike Table.close(), this must not render the table unusable for subsequent read operations. Implementations should be sure to call super.releaseCachedResources().
      Specified by:
      releaseCachedResources in interface Table
    • addUpdateListener

      @FinalDefault default void addUpdateListener(ShiftObliviousListener listener)
      Description copied from interface: Table
      Subscribe for updates to this table. listener will be invoked via the NotificationQueue associated with this Table.
      Specified by:
      addUpdateListener in interface Table
      Parameters:
      listener - listener for updates