Package org.apache.sis.util.collection
Interface TreeTable
- All Known Implementing Classes:
DefaultTreeTable
,TreeTableView
public interface TreeTable
Defines the structure (list of columns) of a table and provides the root of the tree
containing the data.
TreeTable
can be seen as a table in which the first
column contains a tree. Every row in this table is a TreeTable.Node
instance, and each
node can have an arbitrary number of children nodes.
Below is an example of what a two-columns TreeTable
instance may look like
when formatted as a text:
In many cases, the columns are known in advance as hard-coded static constants.
Those column constants are typically documented close to the class producing the
TreeTable
instance. Using directly those static constants provides type
safety, as in the following example:
TreeTable.Node.getValue(TableColumn)
method is determined by the column constant. However, this approach is possible only when
the table structure is known in advance. If a method needs to work with arbitrary tables,
then that method can get the list of columns by a call to getColumns()
. However
this column list does not provide the above type-safety.- Since:
- 0.3
- Version:
- 0.3
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
A node in a tree combined with a row in a table. -
Method Summary
Modifier and TypeMethodDescriptionList<TableColumn<?>>
Returns the table columns, in the order they shall be rendered by default.getRoot()
Returns the root node of the tree.
-
Method Details
-
getColumns
List<TableColumn<?>> getColumns()Returns the table columns, in the order they shall be rendered by default. This method returns the union of all table columns in every nodes of this tree. However, anyTreeTable.Node
instance can returnnull
for a particular column if the node doesn't have that column.- Returns:
- the union of all table columns in every tree node.
- See Also:
-
getRoot
TreeTable.Node getRoot()Returns the root node of the tree.- Returns:
- the root node of the tree.
-