com.novell.sentinel.client.tinyq
Enum Operator

java.lang.Object
  extended by java.lang.Enum<Operator>
      extended by com.novell.sentinel.client.tinyq.Operator
All Implemented Interfaces:
Serializable, Comparable<Operator>

public enum Operator
extends Enum<Operator>

Enum describing operators in the TinyQuery language.


Enum Constant Summary
AND
           
EQUAL
           
GREATER_THAN
           
GREATER_THAN_OR_EQUAL
           
GROUP_LEFT
           
GROUP_RIGHT
           
LESS_THAN
           
LESS_THAN_OR_EQUAL
           
LIKE
           
NOT
           
NOT_AN_OPERATOR
           
NOT_EQUAL
           
OR
           
 
Field Summary
static char OPERATOR_PREFIX
          Lexical symbol used to prefix operator symbols to indicate the operator symbols are not to be interpreted as literal characters.
 
Method Summary
 int getPrecedence()
          Return the precedence value of this Operator.
 boolean isBinary()
           
static Operator mapToOperator(char c)
          Given a character, return the corresponding Operator, if any.
 String toQueryString()
          Return the lexical representation of the operator.
 String toString()
          Return a human-readable string representing the operator.
static Operator valueOf(String name)
          Returns the enum constant of this type with the specified name.
static Operator[] 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

NOT

public static final Operator NOT

LESS_THAN

public static final Operator LESS_THAN

LESS_THAN_OR_EQUAL

public static final Operator LESS_THAN_OR_EQUAL

GREATER_THAN

public static final Operator GREATER_THAN

GREATER_THAN_OR_EQUAL

public static final Operator GREATER_THAN_OR_EQUAL

EQUAL

public static final Operator EQUAL

NOT_EQUAL

public static final Operator NOT_EQUAL

LIKE

public static final Operator LIKE

OR

public static final Operator OR

AND

public static final Operator AND

GROUP_LEFT

public static final Operator GROUP_LEFT

GROUP_RIGHT

public static final Operator GROUP_RIGHT

NOT_AN_OPERATOR

public static final Operator NOT_AN_OPERATOR
Field Detail

OPERATOR_PREFIX

public static final char OPERATOR_PREFIX
Lexical symbol used to prefix operator symbols to indicate the operator symbols are not to be interpreted as literal characters.

See Also:
Constant Field Values
Method Detail

values

public static Operator[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (Operator c : Operator.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Operator valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getPrecedence

public int getPrecedence()
Return the precedence value of this Operator. Larger values indicate higher precedence.

Returns:
Precedence value.

isBinary

public boolean isBinary()
Returns:
true if the operator is binary, false if the operator is unary.

toString

public String toString()
Return a human-readable string representing the operator.

Overrides:
toString in class Enum<Operator>

toQueryString

public String toQueryString()
Return the lexical representation of the operator.

Returns:
The lexical representation of the operator in the language.

mapToOperator

public static Operator mapToOperator(char c)
Given a character, return the corresponding Operator, if any.

Parameters:
c - Character to check.
Returns:
The corresponding Operator, or NOT_AN_OPERATOR if the passed char doesn't correspond to an operator.