Class ColumnFilterData<T>

  • Type Parameters:
    T - the column type.
    All Implemented Interfaces:
    java.lang.Comparable<ColumnFilterData<T>>

    public class ColumnFilterData<T>
    extends java.lang.Object
    implements java.lang.Comparable<ColumnFilterData<T>>
    Class for maintaining information about a table's column for the purpose of configuring filters based on that columns values. These are generated by examining a table's column types and finding out if there are any ColumnConstraints that support that type. If so, a ColumnFilterData is created for that column which then allows filtering on that columns data.
    • Constructor Detail

      • ColumnFilterData

        public ColumnFilterData​(RowObjectFilterModel<?> model,
                                int columnModelIndex,
                                int columnViewIndex,
                                java.lang.Class<T> columnClass)
        Constructs a new ColumnFilterData for a table column
        Parameters:
        model - the table model
        columnModelIndex - the model index of the column
        columnViewIndex - the view index of the column
        columnClass - the class (type) of the column
    • Method Detail

      • setViewIndex

        public void setViewIndex​(int viewIndex)
        Sets the viewIndex

        This needs to be updated whenever columns are added, deleted, or moved.

        Parameters:
        viewIndex - the new view index
      • getViewIndex

        public int getViewIndex()
        Returns the view index of the column
        Returns:
        the view index of the column.
      • isFilterable

        public boolean isFilterable()
        Returns true if the column represented by this data has applicable column filters.
        Returns:
        true if the column represented by this data has applicable column filters.
      • getConstraints

        public ColumnConstraint<?>[] getConstraints()
        Returns the list of applicable constraints for this column
        Returns:
        the list of applicable constraints for this column
      • getName

        public java.lang.String getName()
        Returns the name of the column represented by this ColumnFilterData
        Returns:
        the name of the column represented by this ColumnFilterData
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getConstraint

        public ColumnConstraint<T> getConstraint​(java.lang.String constraintName)
        Returns the ColumnConstraint with the given name
        Parameters:
        constraintName - the name of the constraint to retrieve
        Returns:
        the ColumnConstraint with the given name.
      • getColumnModelIndex

        public int getColumnModelIndex()
        Returns the model index for the column represented by this class.
        Returns:
        the model index for the column represented by this class.
      • getFirstConstraint

        public ColumnConstraint<T> getFirstConstraint()
        Returns the first constraint in the list.
        Returns:
        the constraint
      • compareTo

        public int compareTo​(ColumnFilterData<T> o)
        Specified by:
        compareTo in interface java.lang.Comparable<T>
      • replace

        public void replace​(ColumnConstraint<T> value)
        Replace the same named constraint with the given constraint. This allows the column constraint to remember the last used value.
        Parameters:
        value - the constraint to be used to replace the existing one with the same name.