|
JIVE Platform Release 0.2.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Objectjava.lang.Enum<RelationalOperator>
edu.buffalo.cse.jive.ui.search.RelationalOperator
public enum RelationalOperator
A representation of a relational operator for use by an
IJiveSearchQuery
. The operator can be used to compare a
Value
object with either another Value
or with a
String
.
Value#Encoded
objects may be compared using any of the available
operators. All other Value
objects can only be compared with
NONE
, EQUAL
, or NOT_EQUAL
.
evaluate(Value, Value)
,
evaluate(Value, String)
Enum Constant Summary | |
---|---|
EQUAL
A relational operator used to determine if two values are equal. |
|
GREATER_THAN
A relational operator used to determine if one value is greater than another value. |
|
GREATER_THAN_OR_EQUAL
A relational operator used to determine if one value is greater than or equal to another value. |
|
LESS_THAN
A relational operator used to determine if one value is less than another value. |
|
LESS_THAN_OR_EQUAL
A relational operator used to determine if one value is less than or equal to another value. |
|
NONE
A relational operator which always evaluates to true . |
|
NOT_EQUAL
A relational operator used to determine if two values are not equal. |
Method Summary | ||
---|---|---|
protected
|
compare(Comparable<T> left,
T right)
Compares the two operands using the Comparable interface. |
|
protected boolean |
compare(String left,
String right)
Compares the supplied strings by first converting them to the appropriate type. |
|
abstract boolean |
evaluate(Value left,
String right)
Evaluates the operator on the supplied values. |
|
abstract boolean |
evaluate(Value left,
Value right)
Evaluates the operator on the supplied values. |
|
static RelationalOperator |
fromString(String operator)
Returns the RelationalOperator represented by the supplied
string. |
|
String |
toString()
|
|
static RelationalOperator |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
|
static RelationalOperator[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
Methods inherited from class java.lang.Enum |
---|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Enum Constant Detail |
---|
public static final RelationalOperator NONE
true
.
public static final RelationalOperator EQUAL
public static final RelationalOperator NOT_EQUAL
public static final RelationalOperator LESS_THAN
public static final RelationalOperator LESS_THAN_OR_EQUAL
public static final RelationalOperator GREATER_THAN
public static final RelationalOperator GREATER_THAN_OR_EQUAL
Method Detail |
---|
public static RelationalOperator[] values()
for (RelationalOperator c : RelationalOperator.values()) System.out.println(c);
public static RelationalOperator valueOf(String name)
name
- the name of the enum constant to be returned.
IllegalArgumentException
- if this enum type has no constant
with the specified name
NullPointerException
- if the argument is nullpublic String toString()
toString
in class Enum<RelationalOperator>
public abstract boolean evaluate(Value left, Value right)
left
- the left operandright
- the right operand
public abstract boolean evaluate(Value left, String right)
left
- the left operandright
- the right operand
protected boolean compare(String left, String right)
left
- the left operandright
- the right operand
protected <T> boolean compare(Comparable<T> left, T right)
Comparable
interface.
T
- the type of the operandsleft
- the left operandright
- the right operand
public static RelationalOperator fromString(String operator)
RelationalOperator
represented by the supplied
string.
operator
- the string representation
|
JIVE Platform Release 0.2.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |