Class RangeColumnConstraint<T>

    • Field Detail

      • name

        protected final java.lang.String name
        This constraints' name

        It sometimes makes grammatical sense to set a more useful name than the default; while 'at least' makes sense for a number-based constraint, 'after' reads better for date-based constraints.

    • Constructor Detail

      • RangeColumnConstraint

        protected RangeColumnConstraint​(java.lang.String name,
                                        T minValue,
                                        T maxValue,
                                        EditorProvider<T> editorProvider,
                                        java.lang.String group)
        Constructor
        Parameters:
        name - the name of the constraint.
        minValue - the min value of the range.
        maxValue - the max value of the range.
        editorProvider - the editor provider that generates the appropriate editors for constraints of this type.
        group - the group of the constraint for visual grouping when presenting to the user.
    • Method Detail

      • getGroup

        public java.lang.String getGroup()
        Description copied from interface: ColumnConstraint
        Returns a "group" string that is used to logically group column constraints for presentation to the user
        Specified by:
        getGroup in interface ColumnConstraint<T>
        Returns:
        the group this constraint belongs to.
      • getName

        public java.lang.String getName()
        Description copied from interface: ColumnConstraint
        Returns the name of the constraint
        Specified by:
        getName in interface ColumnConstraint<T>
        Returns:
        the name of the constraint.
      • getMinValue

        public T getMinValue()
        Returns the min value of the range used by this constraint.
        Returns:
        the min value of the range used by this constraint.
      • getMaxValue

        public T getMaxValue()
        Returns the max value of the range used by this constraint.
        Returns:
        the max value of the range used by this constraint.
      • getColumnType

        public java.lang.Class<T> getColumnType()
        Description copied from interface: ColumnConstraint
        Returns the column type that this constraint can be used to filter.
        Specified by:
        getColumnType in interface ColumnConstraint<T>
        Returns:
        the column type
      • getEditor

        public final ColumnConstraintEditor<T> getEditor​(ColumnData<T> columnDataSource)
        Description copied from interface: ColumnConstraint
        Returns a ColumnConstraintEditor which will provide gui components for users to edit the constraint values.
        Specified by:
        getEditor in interface ColumnConstraint<T>
        Parameters:
        columnDataSource - This provides the constraint with access to the column data in the table model as well as the DataProvider of the table (if it has one)
        Returns:
        A columnConstraintEditor for editing the constraints value.
      • getConstraintValueString

        public java.lang.String getConstraintValueString()
        Description copied from interface: ColumnConstraint
        Returns the "value" of the constraint in string form

        This is used for serializing the constraint.

        Specified by:
        getConstraintValueString in interface ColumnConstraint<T>
        Returns:
        the "value" of the constraint in string form.
      • parseConstraintValue

        public ColumnConstraint<T> parseConstraintValue​(java.lang.String newValue,
                                                        java.lang.Object dataSource)
        Description copied from interface: ColumnConstraint
        Parses the constraint value string for deserialization purposes.
        Specified by:
        parseConstraintValue in interface ColumnConstraint<T>
        Parameters:
        newValue - the value of the constraint in string form.
        dataSource - the DataSource from the Table.
        Returns:
        a new ColumnConstraint
      • copy

        public abstract RangeColumnConstraint<T> copy​(T min,
                                                      T max)
        subclasses must override to generate new versions of themselves but with new range values.
        Parameters:
        min - the min value of the range.
        max - the max value of the range.
        Returns:
        a new ColumnConstraint that is the same type as this constraint but with a new range defined.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object