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 {@code TreeTable} instance. Using directly those static constants provides typesafety, as in the following example:
{@preformat javaTreeTable 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 {@link 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 {@link #getColumns()}. However this column list does not provide the above type-safety. @author Martin Desruisseaux (Geomatys) @since 0.3 @version 0.3 @module
|
|
|
|
|
|
|
|
|
|
|
|