public enum CompareOperator extends Enum<CompareOperator> implements SimpleDatatype<String>, NlsObject
CompareOperator represents a function that compares two given values.| Enum Constant and Description |
|---|
EQUAL
CompareOperator to check if objects are equal. |
GREATER_OR_EQUAL
CompareOperator to check if some value is greater or equal to another. |
GREATER_THAN
CompareOperator to check if some value is greater than another. |
LESS_OR_EQUAL
CompareOperator to check if some value is less or equal than another. |
LESS_THAN
CompareOperator to check if some value is less than another. |
NOT_EQUAL
CompareOperator to check if objects are NOT equal. |
| Modifier and Type | Field and Description |
|---|---|
private String |
title |
private String |
value |
KEY_ANNOTATION, KEY_ARGUMENT, KEY_CAPACITY, KEY_CONTAINER, KEY_DEFAULT, KEY_DIRECTORY, KEY_ERROR, KEY_EXISTING, KEY_EXPECTED, KEY_FILE, KEY_FUNCTION, KEY_ID, KEY_KEY, KEY_LOCATION, KEY_MAX, KEY_MIN, KEY_MODE, KEY_NAME, KEY_OBJECT, KEY_OPERAND, KEY_OPERATION, KEY_OPTION, KEY_PATH, KEY_PROPERTY, KEY_QUERY, KEY_RESOURCE, KEY_SIZE, KEY_SOURCE, KEY_TARGET_TYPE, KEY_TITLE, KEY_TYPE, KEY_URI, KEY_USER, KEY_VALUE| Modifier and Type | Method and Description |
|---|---|
private Object |
convert(Object object,
Class<?> otherType) |
abstract boolean |
eval(double arg1,
double arg2)
This method evaluates this
CompareOperator for the given arguments. |
boolean |
eval(Object arg1,
Object arg2)
This method evaluates this
CompareOperator for the given arguments. |
private boolean |
evalComparable(Comparable arg1,
Comparable arg2)
This method handles
eval(Object, Object) for two Comparables. |
static CompareOperator |
fromValue(String value)
This method gets the
CompareOperator for the given symbol. |
private static NlsBundleUtilCoreRoot |
getBundle() |
String |
getValue()
This method gets the symbol of the
CompareOperator. |
(package private) boolean |
isTrueIfEquals() |
(package private) boolean |
isTrueIfGreater() |
(package private) boolean |
isTrueIfLess() |
abstract CompareOperator |
negate() |
String |
toString()
|
static CompareOperator |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static CompareOperator[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOftoNlsMessagepublic static final CompareOperator GREATER_THAN
CompareOperator to check if some value is greater than another.public static final CompareOperator GREATER_OR_EQUAL
CompareOperator to check if some value is greater or equal to another.public static final CompareOperator LESS_THAN
CompareOperator to check if some value is less than another.public static final CompareOperator LESS_OR_EQUAL
CompareOperator to check if some value is less or equal than another.public static final CompareOperator EQUAL
CompareOperator to check if objects are equal.public static final CompareOperator NOT_EQUAL
CompareOperator to check if objects are NOT equal.public static CompareOperator[] values()
for (CompareOperator c : CompareOperator.values()) System.out.println(c);
public static CompareOperator 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 nullboolean isTrueIfEquals()
true if this CompareOperator evaluates to true for
Objects that are equal to each other, false otherwise.boolean isTrueIfLess()
true if this CompareOperator evaluates to true in
case the first argument is less than the second, false otherwise.boolean isTrueIfGreater()
true if this CompareOperator evaluates to true in
case the first argument is greater than the second, false otherwise.public String getValue()
CompareOperator. E.g. "==", ">", ">=", etc.getValue in interface AttributeReadValue<String>getValue in interface SimpleDatatype<String>private static NlsBundleUtilCoreRoot getBundle()
NlsBundleUtilCoreRoot.public abstract boolean eval(double arg1,
double arg2)
CompareOperator for the given arguments.arg1 - is the first argument.arg2 - is the second argument.CompareOperator applied to the given arguments.public abstract CompareOperator negate()
CompareOperator that evaluates to the negated
result.private Object convert(Object object, Class<?> otherType)
object - is the value to convert.otherType - the type of the value to compare that differs from the typevalue or the same value if on simpler type is known.ComparatorHelper.convert(Object, Class)private boolean evalComparable(Comparable arg1, Comparable arg2)
eval(Object, Object) for two Comparables.arg1 - is the first argument.arg2 - is the second argument.CompareOperator applied to the given arguments.public boolean eval(Object arg1, Object arg2)
CompareOperator for the given arguments.arg1 - is the first argument.arg2 - is the second argument.CompareOperator applied to the given arguments.public String toString()
DatatypeString representation of this Datatype. While the general contract of
Object.toString() is very weak and mainly used for debugging, the contract here is very strong. The
returned String has to be suitable for end-users and official output to any kind of sink. NlsMessage for
this purpose and implement NlsObject if you want to support I18N/L10N.public static CompareOperator fromValue(String value)
CompareOperator for the given symbol.value - is the symbol of the requested CompareOperator.CompareOperator or null if no such CompareOperator exists.Copyright © 2001–2016 mmm-Team. All rights reserved.