Class ColumnConstraintSet<R,T>
java.lang.Object
docking.widgets.table.columnfilter.ColumnConstraintSet<R,T>
- Type Parameters:
R
- the row type of the table being filtered.T
- the column type of column whose values are being tested by this filter.
This class maintains a collection of
ColumnConstraint
that are applied to a specific table column
for filtering purposes. In order for this ColumnConstraintSet to "pass", (i.e. accept the table
row) the column value for that row must pass at least one of the constraints in this set, thus
effectively OR'ing the constraints.
Instances of this class are used by the ColumnBasedTableFilter
to filter rows of table.
-
Constructor Summary
ConstructorDescriptionColumnConstraintSet
(RowObjectTableModel<R> model, int columnIndex, List<ColumnConstraint<T>> constraints, LogicOperation logicOperation) ConstructorColumnConstraintSet
(RowObjectTableModel<R> model, SaveState saveState, Object dataSource) Constructor when deserializing from a SaveState -
Method Summary
Modifier and TypeMethodDescriptionboolean
accepts
(R rowObject, TableFilterContext context) Return true if the given table row object passes this filter.boolean
int
Returns the model index of the column whose values will be tested by this filter.Return the name of the column whose values will be tested by this filter.Returns a list of ColumnConstraints in this ColumnFilterReturns the logical operation (AND or OR) for how to combine this object'saccepts(Object, TableFilterContext)
results with the results of previous constraintSet results in the overall filter.int
hashCode()
toString()
-
Constructor Details
-
ColumnConstraintSet
public ColumnConstraintSet(RowObjectTableModel<R> model, int columnIndex, List<ColumnConstraint<T>> constraints, LogicOperation logicOperation) Constructor- Parameters:
model
- the table model being filtered.columnIndex
- the index of the column whose values are tested by this filter.constraints
- the list of ColumnConstraints whose results are or'ed together.logicOperation
- the logical operation for how this constraintSet relates to other contraint sets.
-
ColumnConstraintSet
Constructor when deserializing from a SaveState- Parameters:
model
- the table model being filteredsaveState
- the SaveState which contains the configuration for this filter.dataSource
- the table's DataSource.
-
-
Method Details
-
getColumnName
Return the name of the column whose values will be tested by this filter.- Returns:
- the name of the column whose values will be tested by this filter.
-
getColumnModelIndex
public int getColumnModelIndex()Returns the model index of the column whose values will be tested by this filter.- Returns:
- the model index of the column whose values will be tested by this filter.
-
accepts
Return true if the given table row object passes this filter.- Parameters:
rowObject
- the table row object.context
- theTableFilterContext
for this table's filter.- Returns:
- true if the given table row object passes this filter.
-
getConstraints
Returns a list of ColumnConstraints in this ColumnFilter- Returns:
- a list of ColumnConstraints in this ColumnFilter
-
getLogicOperation
Returns the logical operation (AND or OR) for how to combine this object'saccepts(Object, TableFilterContext)
results with the results of previous constraintSet results in the overall filter.- Returns:
- the logical operation (AND or OR)
-
hashCode
public int hashCode() -
equals
-
toString
-