Class DefaultTreeTable

All Implemented Interfaces:
Serializable, Cloneable, Tree­Table

public class DefaultTreeTable extends Object implements TreeTable, Cloneable, Serializable
A Tree­Table implementation with a list of columns given at construction time. The list of columns is unmodifiable, but the root node can be modified. Example:
public class CityLocation {
    public static final TableColumn<String> CITY_NAME  = new TableColumn<>(String.class, "City name");
    public static final TableColumn<Float>  LATITUDE   = new TableColumn<>(Float.class,  "Latitude");
    public static final TableColumn<Float>  LONGTITUDE = new TableColumn<>(Float.class,  "Longitude");

    public TreeTable createTable() {
        DefaultTreeTable table = new DefaultTreeTable(CITY_NAME, LATITUDE, LONGITUDE);
        TreeTable.Node   city  = table.getRoot();
        city.setValue(CITY_NAME, "Rimouski");
        city.setValue(LATITUDE,   48.470417);
        city.setValue(LONGITUDE, -68.521385);
        return table;
The set­Root(…) method accepts arbitrary Tree­Table​.Node implementations. However it is likely to be safer and more memory efficient when used together with the implementation provided in the Default­Tree­Table​.Node inner class.
See Also:

Defined in the sis-utility module