public enum CmpOperator extends java.lang.Enum<CmpOperator>
| Enum Constant and Description |
|---|
EQUAL
the "equals" operator
|
GREATER_THAN
the "greater than" operator
|
GREATER_THAN_OR_EQUAL
the "greater than or equal" operator
|
LESS_THAN
the "less than" operator
|
LESS_THAN_OR_EQUAL
the "less than or equal" operator
|
LIKE
The "like" operator works like SQL's LIKE operator.
|
LIKE_IGNORECASE
A case insensitive version of
LIKE. |
NOT_EQUAL
the "not equals" operator
|
NOT_LIKE
A negated
LIKE operator. |
NOT_LIKE_IGNORECASE
A case insensitive version of
NOT_LIKE. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canCompare(DataType dataType)
Returns whether this comparison operator can generally work on the given
data type.
|
boolean |
canCompare(DataType columnDataType,
DataType valueDataType)
Returns whether this operator can compare the two given data types.
|
static CmpOperator |
getCmpOperatorForSymbol(java.lang.String symbol)
Returns the comparison operator to which the given symbol belongs or
null if the symbol is not recognised. |
java.lang.String |
getSymbol()
Returns this comparison operator's associated symbol.
|
static CmpOperator |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static CmpOperator[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final CmpOperator EQUAL
public static final CmpOperator NOT_EQUAL
public static final CmpOperator GREATER_THAN
public static final CmpOperator GREATER_THAN_OR_EQUAL
public static final CmpOperator LESS_THAN
public static final CmpOperator LESS_THAN_OR_EQUAL
public static final CmpOperator LIKE
_ is a
placeholder for exactly one character; % is a placeholder
for an arbitrary number of characters (even zero). Only works on strings.public static final CmpOperator NOT_LIKE
LIKE operator. Only works on strings.public static final CmpOperator LIKE_IGNORECASE
public static final CmpOperator NOT_LIKE_IGNORECASE
public static CmpOperator[] values()
for (CmpOperator c : CmpOperator.values()) System.out.println(c);
public static CmpOperator valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is nullpublic java.lang.String getSymbol()
public static CmpOperator getCmpOperatorForSymbol(java.lang.String symbol)
null if the symbol is not recognised.symbol - the symbol for which to find the comparison operatornullpublic boolean canCompare(DataType dataType)
null this
method will determine if the operator can deal with null
values (at the time of writing, only EQUAL and NOT_EQUAL
can do that).dataType - the data type to be testedpublic boolean canCompare(DataType columnDataType, DataType valueDataType)
null. The right-hand data type is the data type of the value or
null if the value itself is null. At the time of
writing, only EQUAL and NOT_EQUAL can compare a
null-value to the value of a column.columnDataType - the left-hand data type (which should be the column's
data type)valueDataType - the right-hand data type (which should be the
value object's data type or null)