Module is.codion.swing.common.model
Interface FilterTableModel.TableColumns<R,C>
- Type Parameters:
R- the row typeC- the column identifier type
- All Known Implementing Classes:
ClientMonitor.RemoteClientColumns,ClientUserMonitor.UserHistoryColumns,DomainGeneratorModel.EntityColumns,DomainGeneratorModel.SchemaColumns,ServerMonitor.DomainColumns,ServerMonitor.OperationColumns,ServerMonitor.ReportColumns
- Enclosing interface:
FilterTableModel<R,C>
public static interface FilterTableModel.TableColumns<R,C>
Specifies the columns for a table model, their identifiers,
their class and how to extract their value from a row instance.
-
Method Summary
Modifier and TypeMethodDescriptiondefault StringThe default implementation simply returnsidentifier.toString()Class<?> columnClass(C identifier) default <T> @Nullable Comparable<T> comparable(R row, C identifier) Returns a Comparable instance for the given row and column.default Comparator<?> comparator(C identifier) Returns the comparator to use when comparing the values of the given columndescription(C identifier) The default implementation returns an emptyOptional.default StringReturns a String representation of the value for the given row and column, an empty String in case of null.default Cidentifier(int index) This method gets called quite often, so it is recommended to return a constant List instance, instead of creating one each time.Returns a value for the given row and identifier
-
Method Details
-
identifiers
This method gets called quite often, so it is recommended to return a constant List instance, instead of creating one each time.- Returns:
- the column identifiers
-
columnClass
- Parameters:
identifier- the column identifier- Returns:
- the column class for the given column
-
value
Returns a value for the given row and identifier- Parameters:
row- the object representing a given rowidentifier- the column identifier- Returns:
- a value for the given row and column
-
caption
The default implementation simply returnsidentifier.toString()- Parameters:
identifier- the column identifier- Returns:
- the caption for the given column
-
description
The default implementation returns an emptyOptional.- Parameters:
identifier- the column identifier- Returns:
- the description for the given column
-
identifier
- Parameters:
index- the identifier index- Returns:
- the identifier at the given index
-
formatted
Returns a String representation of the value for the given row and column, an empty String in case of null.- Parameters:
row- the rowidentifier- the column identifier- Returns:
- a String representation of the value for the given row and column, an empty String in case of null
-
comparable
Returns a Comparable instance for the given row and column.Null is returned if the underlying column value is not a
Comparableinstance.- Type Parameters:
T- the column value type- Parameters:
row- the object representing a given rowidentifier- the column identifier- Returns:
- a Comparable for the given row and column
-
comparator
Returns the comparator to use when comparing the values of the given column- Parameters:
identifier- the column identifier- Returns:
- a Comparator for the given column
-