public enum ValueComparator extends Enum<ValueComparator>
Value objects.
Some rules:
NOT_EQUAL_TO
null.
NOT_EQUAL_TO a value of
another type, except for the numeric types.
null values are EQUAL_TO
each other.
null value is NOT_EQUAL_TO any
non-null value.
| Enum Constant and Description |
|---|
EQUAL_TO
The two values are equal (=).
|
GREATER_THAN
The first value is greater than (>) the second.
|
GREATER_THAN_OR_EQUAL_TO
The first value is greater than or equal to (>=) the second.
|
IN
The value is in the list.
|
LESS_THAN
The first value is less than (<) the second.
|
LESS_THAN_OR_EQUAL_TO
The first value is less than or equal to (<=) the second.
|
NOT_EQUAL_TO
The two values are not equal (!=).
|
NOT_IN
The value is not in the list.
|
UNKNOWN
Unknown, meaning that Protempa cannot tell, for example, if a value
may be less than another value but Protempa cannot tell with complete
certainty.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
compare(Value lhsValue,
Value rhsValue)
Returns whether two values have the relationship specified by this
value comparator.
|
String |
getComparatorString()
Gets the string associated with this comparator object.
|
abstract boolean |
includes(ValueComparator comparator)
Returns whether this
ValueComparator is the same as or includes
the specified ValueComparator. |
static ValueComparator |
parse(String compString)
Gets the comparison object corresponding to the given mathematical
comparison symbol.
|
static ValueComparator |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ValueComparator[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ValueComparator GREATER_THAN
public static final ValueComparator LESS_THAN
public static final ValueComparator EQUAL_TO
public static final ValueComparator NOT_EQUAL_TO
public static final ValueComparator UNKNOWN
public static final ValueComparator GREATER_THAN_OR_EQUAL_TO
EQUAL_TO and
GREATER_THAN.public static final ValueComparator LESS_THAN_OR_EQUAL_TO
public static final ValueComparator IN
public static final ValueComparator NOT_IN
public static ValueComparator[] values()
for (ValueComparator c : ValueComparator.values()) System.out.println(c);
public static ValueComparator valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic static ValueComparator parse(String compString)
LESS_THAN.GREATER_THAN.LESS_THAN_OR_EQUAL_TO.GREATER_THAN_OR_EQUAL_TO.EQUAL_TO.NOT_EQUAL_TO.compString - a String from the above list.ValueComparator corresponding to the given
comparison string, or null if one of the above
strings was not passed in.ValueComparatorFormatException - if compString could not be parsed.public abstract boolean includes(ValueComparator comparator)
ValueComparator is the same as or includes
the specified ValueComparator.comparator - a ValueComparator.true if this ValueComparator is subsumed by
the specified ValueComparator, false
otherwise.public boolean compare(Value lhsValue, Value rhsValue)
Value.compare(org.protempa.proposition.value.Value) method,
except it also handles gracefully the value being null.lhsValue - the left-hand-side value. May be null.rhsValue - the right-hand-side value. May be null.true if the two values have the relationship
specified by this value comparator, false if not.Copyright © 2012–2018 Emory University. All rights reserved.