Package xal.tools.data
Class KeyValueQualifier
java.lang.Object
xal.tools.data.KeyValueQualifier
- All Implemented Interfaces:
Qualifier
Check that a record's value corresponding to the specified key compares to
the specified value based on the comparison type.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
comparison operation - record's value corresponding to qualifier's key must be equal to the qualifier's valuestatic final int
comparison operation - record's value corresponding to qualifier's key must be greater than the qualifier's valuestatic final int
comparison operation - record's value corresponding to qualifier's key must be greater than or equal to the qualifier's valuestatic final int
comparison operation - record's value corresponding to qualifier's key must be less than the qualifier's valuestatic final int
comparison operation - record's value corresponding to qualifier's key must be less than or equal to the qualifier's value -
Constructor Summary
ConstructorsConstructorDescriptionKeyValueQualifier
(String key, Comparable value) Constructor in which the default comparison operation (equality) is used.KeyValueQualifier
(String key, Comparable<Object> value, int operation) Primary Constructor -
Method Summary
-
Field Details
-
COMPARE_LESS_THAN
public static final int COMPARE_LESS_THANcomparison operation - record's value corresponding to qualifier's key must be less than the qualifier's value- See Also:
-
COMPARE_LESS_THAN_OR_EQUALS
public static final int COMPARE_LESS_THAN_OR_EQUALScomparison operation - record's value corresponding to qualifier's key must be less than or equal to the qualifier's value- See Also:
-
COMPARE_EQUALS
public static final int COMPARE_EQUALScomparison operation - record's value corresponding to qualifier's key must be equal to the qualifier's value- See Also:
-
COMPARE_GREATER_THAN_OR_EQUALS
public static final int COMPARE_GREATER_THAN_OR_EQUALScomparison operation - record's value corresponding to qualifier's key must be greater than or equal to the qualifier's value- See Also:
-
COMPARE_GREATER_THAN
public static final int COMPARE_GREATER_THANcomparison operation - record's value corresponding to qualifier's key must be greater than the qualifier's value- See Also:
-
-
Constructor Details
-
KeyValueQualifier
Primary Constructor- Parameters:
key
- the key for which the record's value is fetchedvalue
- the value with which to the compare the record's value for the specified keyoperation
- the code corresponding to the comparison operation
-
KeyValueQualifier
Constructor in which the default comparison operation (equality) is used.- Parameters:
key
- the key for which the record's value is fetchedvalue
- the value with which to the compare the record's value for the specified key
-
-
Method Details
-
matches
Determine if the specified object is a match to this qualifier's criteria. The object must implement the KeyedRecord interface and its value corresponding to_key
must implement the java.util.Comparable interface. See java.util.Comparable for more information.- Specified by:
matches
in interfaceQualifier
- Parameters:
object
- the object to test for matching- Returns:
- true if the object matches the criteria and false if not.
- Throws:
ClassCastException
- if the object does not implement the Comparable interface
-
toString
Get a string representation of this instance
-