Package docking.widgets.table.constraint
Class NotInRangeColumnConstraint<T extends java.lang.Comparable<T>>
- java.lang.Object
-
- docking.widgets.table.constraint.RangeColumnConstraint<T>
-
- docking.widgets.table.constraint.NotInRangeColumnConstraint<T>
-
- Type Parameters:
T
- the column type.
- All Implemented Interfaces:
ColumnConstraint<T>
,java.lang.Comparable<ColumnConstraint<T>>
public class NotInRangeColumnConstraint<T extends java.lang.Comparable<T>> extends RangeColumnConstraint<T>
Column Constraint where acceptable column values are outside some range defined by a min value and a max value.
-
-
Field Summary
-
Fields inherited from class docking.widgets.table.constraint.RangeColumnConstraint
editorProvider, name
-
-
Constructor Summary
Constructors Constructor Description NotInRangeColumnConstraint(java.lang.String name, T minValue, T maxValue, EditorProvider<T> editorProvider, java.lang.String group)
Construct a new instance of this class that specifies the name and group and specifies the min and max values for the range.NotInRangeColumnConstraint(T minValue, T maxValue, EditorProvider<T> editorProvider)
Construct a new instance of this class that uses the default name and group and specifies the min and max values for the range.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
accepts(T value, TableFilterContext context)
Compares value against the current constraint value to determine acceptance; true if value satisfies the constraints' value, false otherwiseRangeColumnConstraint<T>
copy(T min, T max)
subclasses must override to generate new versions of themselves but with new range values.-
Methods inherited from class docking.widgets.table.constraint.RangeColumnConstraint
equals, getColumnType, getConstraintValueString, getEditor, getGroup, getMaxValue, getMinValue, getName, hashCode, parseConstraintValue
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface docking.widgets.table.constraint.ColumnConstraint
asString, compareTo, getConstraintValueTooltip
-
-
-
-
Constructor Detail
-
NotInRangeColumnConstraint
public NotInRangeColumnConstraint(T minValue, T maxValue, EditorProvider<T> editorProvider)
Construct a new instance of this class that uses the default name and group and specifies the min and max values for the range.- Parameters:
minValue
- the min value of the acceptable range.maxValue
- the max value of the acceptable range.editorProvider
- an object that can provide an appropriate range editor for the column type.
-
NotInRangeColumnConstraint
public NotInRangeColumnConstraint(java.lang.String name, T minValue, T maxValue, EditorProvider<T> editorProvider, java.lang.String group)
Construct a new instance of this class that specifies the name and group and specifies the min and max values for the range.- Parameters:
name
- the constraint to use instead of the default "Not In Range".minValue
- the min value of the acceptable range.maxValue
- the max value of the acceptable range.editorProvider
- an object that can provide an appropriate range editor for the column type.group
- the group to use instead of the default value of "number".
-
-
Method Detail
-
accepts
public boolean accepts(T value, TableFilterContext context)
Description copied from interface:ColumnConstraint
Compares value against the current constraint value to determine acceptance; true if value satisfies the constraints' value, false otherwise- Parameters:
value
- the column value to be tested.context
- provides additional information about the the table and its data. This allows the filter to base its decision on information other than just the column value.- Returns:
- true if the column value passes the constraint, false otherwise
-
copy
public RangeColumnConstraint<T> copy(T min, T max)
Description copied from class:RangeColumnConstraint
subclasses must override to generate new versions of themselves but with new range values.- Specified by:
copy
in classRangeColumnConstraint<T extends java.lang.Comparable<T>>
- 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.
-
-