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
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceRecorder 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_ATTRIBUTEFields 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 thetreeoperation.Get theTableDefinitionthat should be exposed to node table consumers, e.g.Get the parent identifier column from the {treeoperation.Get arecorderfor per-node operations to apply during snapshots.static TablepromoteOrphans(@NotNull Table source, @NotNull String idColumn, @NotNull String parentColumn) Create a new TreeTable based onnewSource, inheriting this TreeTable'sidentifier column,parent column,node filter columns, andnode operations.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 withcolumnsdesignated for node-level filtering, in addition to any columns already so-designated onthisTreeTable.withNodeOperations(@NotNull TreeTable.NodeOperationsRecorder nodeOperations) Get a new TreeTable that will apply therecordedoperations to nodes when gathering snapshots.Methods inherited from interface io.deephaven.engine.table.AttributeMap
getAttribute, getAttributeKeys, getAttributes, getAttributes, hasAttribute, retainingAttributes, withAttributes, withAttributes, withoutAttributesMethods inherited from interface io.deephaven.engine.table.GridAttributes
clearSortingRestrictions, restrictSortTo, setLayoutHints, withColumnDescription, withColumnDescriptions, withDescriptionMethods inherited from interface io.deephaven.engine.table.hierarchical.HierarchicalTable
getAvailableColumnDefinitions, getDescription, getEmptyExpansionsTable, getRoot, getRowDepthColumn, getRowExpandedColumn, getSource, getStructuralColumnDefinitions, makeSnapshotState, snapshotMethods inherited from interface io.deephaven.engine.liveness.LivenessReferent
dropReference, getReferentDescription, getWeakReference, retainReference, tryRetainReference
-
Method Details
-
getIdentifierColumn
ColumnName getIdentifierColumn()Get the identifier column from thetreeoperation.- Returns:
- The identifier column
-
getParentIdentifierColumn
ColumnName getParentIdentifierColumn()Get the parent identifier column from the {treeoperation.- Returns:
- The parent identifier column
-
getNodeDefinition
TableDefinition getNodeDefinition()Get theTableDefinitionthat 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 columnandrow-expanded column, but includes formatting columns.- Returns:
- The externally-visible node
TableDefinition
-
withNodeFilterColumns
Get a new TreeTable withcolumnsdesignated for node-level filtering, in addition to any columns already so-designated onthisTreeTable.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 arecorderfor per-node operations to apply during snapshots.- Returns:
- The new recorder
-
withNodeOperations
Get a new TreeTable that will apply therecordedoperations to nodes when gathering snapshots.- Parameters:
nodeOperations- The node-level operations to apply. Must have been initially supplied bymakeNodeOperationsRecorder()fromthisTreeTable.- Returns:
- The new TreeTable
-
rebase
Create a new TreeTable based onnewSource, inheriting this TreeTable'sidentifier column,parent column,node filter columns, andnode operations.- Parameters:
newSource- A new source table that must have the same definition as the source of this tree; that isnewSource.getDefinition().equals(getSource().getDefinition())must betrue- Returns:
- The new TreeTable
-
promoteOrphans
static Table promoteOrphans(@NotNull @NotNull Table source, @NotNull @NotNull String idColumn, @NotNull @NotNull String parentColumn) Adapt asourceTableto be used for atreeto 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 sourceTableidColumn- 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,nullfor rows that are part of the root table- Returns:
- A
Tablederived fromsourcethat hasnullas the parent for any nodes that would have been orphaned by a call tosource.tree(idColumn, parentColumn)
-