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 Object
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 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

      public ColumnConstraintSet(RowObjectTableModel<R> model, SaveState saveState, Object dataSource)
      Constructor when deserializing from a SaveState
      Parameters:
      model - the table model being filtered
      saveState - the SaveState which contains the configuration for this filter.
      dataSource - the table's DataSource.
  • Method Details

    • getColumnName

      public 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 - the TableFilterContext for this table's filter.
      Returns:
      true if the given table row object passes this filter.
    • getConstraints

      public 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's accepts(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 class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object