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.
public class ColumnConstraintSet<R,T> extends java.lang.Object
This class maintains a collection ofColumnConstraint
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
Constructors Constructor Description ColumnConstraintSet(RowObjectTableModel<R> model, int columnIndex, java.util.List<ColumnConstraint<T>> constraints, LogicOperation logicOperation)
ConstructorColumnConstraintSet(RowObjectTableModel<R> model, SaveState saveState, java.lang.Object dataSource)
Constructor when deserializing from a SaveState
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
accepts(R rowObject, TableFilterContext context)
Return true if the given table row object passes this filter.boolean
equals(java.lang.Object obj)
int
getColumnModelIndex()
Returns the model index of the column whose values will be tested by this filter.java.lang.String
getColumnName()
Return the name of the column whose values will be tested by this filter.java.util.List<ColumnConstraint<T>>
getConstraints()
Returns a list of ColumnConstraints in this ColumnFilterLogicOperation
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.int
hashCode()
java.lang.String
toString()
-
-
-
Constructor Detail
-
ColumnConstraintSet
public ColumnConstraintSet(RowObjectTableModel<R> model, int columnIndex, java.util.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
public ColumnConstraintSet(RowObjectTableModel<R> model, SaveState saveState, java.lang.Object dataSource)
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 Detail
-
getColumnName
public java.lang.String 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
public boolean accepts(R rowObject, TableFilterContext context)
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
public java.util.List<ColumnConstraint<T>> getConstraints()
Returns a list of ColumnConstraints in this ColumnFilter- Returns:
- a list of ColumnConstraints in this ColumnFilter
-
getLogicOperation
public LogicOperation 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()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-