Interface TreeTable

All Known Implementing Classes:
Default­Tree­Table

public interface TreeTable
Defines the structure (list of columns) of a table and provides the root of the tree containing the data. Tree­Table can be seen as a table in which the first column contains a tree. Every row in this table is a Tree­Table​.Node instance, and each node can have an arbitrary number of children nodes.

Below is an example of what a two-columns Tree­Table instance may look like when formatted as a text:

   Citation
     ├─Title…………………………………………………………… Open Geospatial Consortium
     ├─Presentation Forms………………………… document digital
     ├─Cited Responsible Parties
     │   ├─Organisation Name………………… Open Geospatial Consortium
     │   ├─Role…………………………………………………… resource provider
     │   └─Contact Info
     │       └─Online Resource
     │           ├─Linkage……………………… https://www.ogc.org/
     │           └─Function…………………… information
     └─Identifiers
         └─Code…………………………………………………… OGC
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 Tree­Table instance. Using directly those static constants provides type safety, as in the following example:
TreeTable table = ...;                   // Put here a TreeTable instance.
TreeTable.Node node = table.getRoot();
CharSequence   name = node.getValue(TableColumn.NAME);
Class<?>       type = node.getValue(TableColumn.TYPE);
In the above example, the type of value returned by the Tree­Table​.Node​.get­Value(Table­Column) 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 get­Columns(). However this column list does not provide the above type-safety.
Since:
0.3
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    A node in a tree combined with a row in a table.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the table columns, in the order they shall be rendered by default.
    Returns the root node of the tree.