Interface TreeTable
- All Superinterfaces:
AttributeMap<TreeTable>
,GridAttributes<TreeTable>
,HierarchicalTable<TreeTable>
,LivenessReferent
- All Known Implementing Classes:
TreeTableImpl
Table.tree(String, String)
tree} operations.-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Recorder for node-level operations to be applied when gathering snapshots.Nested classes/interfaces inherited from interface io.deephaven.engine.table.hierarchical.HierarchicalTable
HierarchicalTable.SnapshotState
-
Field Summary
Fields inherited from interface io.deephaven.engine.table.GridAttributes
COLUMN_DESCRIPTIONS_ATTRIBUTE, DESCRIPTION_ATTRIBUTE, LAYOUT_HINTS_ATTRIBUTE, SORTABLE_COLUMNS_ATTRIBUTE
Fields inherited from interface io.deephaven.engine.table.hierarchical.HierarchicalTable
KEY_TABLE_ACTION_CONTRACT, KEY_TABLE_ACTION_EXPAND, KEY_TABLE_ACTION_EXPAND_ALL
-
Method Summary
Modifier and TypeMethodDescriptionGet the identifier column from thetree
operation.Get theTableDefinition
that should be exposed to node table consumers, e.g.Get the parent identifier column from the {tree
operation.Get arecorder
for per-node operations to apply during snapshots.static Table
promoteOrphans
(@NotNull Table source, @NotNull String idColumn, @NotNull String parentColumn) withFilter
(@NotNull Filter filter) Apply a filter to the columns of this TreeTable in order to produce a new TreeTable.withNodeFilterColumns
(@NotNull Collection<? extends ColumnName> columns) Get a new TreeTable withcolumns
designated for node-level filtering, in addition to any columns already so-designated onthis
TreeTable.withNodeOperations
(@NotNull TreeTable.NodeOperationsRecorder nodeOperations) Get a new TreeTable that will apply therecorded
operations to nodes when gathering snapshots.Methods inherited from interface io.deephaven.engine.table.AttributeMap
getAttribute, getAttributeKeys, getAttributes, getAttributes, hasAttribute, retainingAttributes, withAttributes, withAttributes, withoutAttributes
Methods inherited from interface io.deephaven.engine.table.GridAttributes
clearSortingRestrictions, restrictSortTo, setLayoutHints, withColumnDescription, withColumnDescriptions, withDescription
Methods inherited from interface io.deephaven.engine.table.hierarchical.HierarchicalTable
getAvailableColumnDefinitions, getDescription, getEmptyExpansionsTable, getRoot, getRowDepthColumn, getRowExpandedColumn, getSource, getStructuralColumnDefinitions, makeSnapshotState, snapshot
Methods inherited from interface io.deephaven.engine.liveness.LivenessReferent
dropReference, getReferentDescription, getWeakReference, retainReference, tryRetainReference
-
Method Details
-
getIdentifierColumn
ColumnName getIdentifierColumn()Get the identifier column from thetree
operation.- Returns:
- The identifier column
-
getParentIdentifierColumn
ColumnName getParentIdentifierColumn()Get the parent identifier column from the {tree
operation.- Returns:
- The parent identifier column
-
getNodeDefinition
TableDefinition getNodeDefinition()Get theTableDefinition
that should be exposed to node table consumers, e.g. UI-driven snapshots. This excludes "internal" columns used to organize the tree or support operations, as well as therow-depth column
androw-expanded column
, but includes formatting columns.- Returns:
- The externally-visible node
TableDefinition
-
withNodeFilterColumns
Get a new TreeTable withcolumns
designated for node-level filtering, in addition to any columns already so-designated onthis
TreeTable.Filters specified via
withFilter(Filter)
, typically from the UI, that only use the designated node-level filtering columns will be applied to the nodes during snapshots. If no node-filter columns are designated, no filters will be handled at node level.Filters that include other columns are handled by filtering the source table in a ancestor-preserving manner and re-applying the tree operation to the result to produce a new TreeTable. Users of orphan promotion or other strategies to govern the structure of the tree should carefully consider the structure of their data before specifying node-filter columns.
Specifying node-filter columns represents a trade-off between performance (which is expected to be much better for node-level filtering) and tree structural integrity (which may be lost since node-level filters are not ancestor-preserving).
- Parameters:
columns
- The columns to designate- Returns:
- The new TreeTable
-
withFilter
Apply a filter to the columns of this TreeTable in order to produce a new TreeTable.- Parameters:
filter
- The filter to apply- Returns:
- The new TreeTable
-
makeNodeOperationsRecorder
TreeTable.NodeOperationsRecorder makeNodeOperationsRecorder()Get arecorder
for per-node operations to apply during snapshots.- Returns:
- The new recorder
-
withNodeOperations
Get a new TreeTable that will apply therecorded
operations to nodes when gathering snapshots.- Parameters:
nodeOperations
- The node-level operations to apply. Must have been initially supplied bymakeNodeOperationsRecorder()
fromthis
TreeTable.- Returns:
- The new TreeTable
-
promoteOrphans
static Table promoteOrphans(@NotNull @NotNull Table source, @NotNull @NotNull String idColumn, @NotNull @NotNull String parentColumn) Adapt asource
Table
to be used for atree
to ensure that the result will have no orphaned nodes. Nodes whose parents do not exist will become children of the root node in the resulting tree. The expected usage pattern is:TreeTable result = promoteOrphans(source, idColumn, parentColumn).tree(idColumn, parentColumn)
- Parameters:
source
- The sourceTable
idColumn
- The name of a column containing a unique identifier for a particular row in the tableparentColumn
- The name of a column containing the parent's identifier,null
for rows that are part of the root table- Returns:
- A
Table
derived fromsource
that hasnull
as the parent for any nodes that would have been orphaned by a call tosource.tree(idColumn, parentColumn)
-