org.norecess.citkit.tir.expressions
Enum OperatorETIR.Operator

java.lang.Object
  extended by java.lang.Enum<OperatorETIR.Operator>
      extended by org.norecess.citkit.tir.expressions.OperatorETIR.Operator
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<OperatorETIR.Operator>, IOperatorETIR.IOperator
Enclosing class:
OperatorETIR

public static enum OperatorETIR.Operator
extends java.lang.Enum<OperatorETIR.Operator>
implements IOperatorETIR.IOperator

Represents an operator like addition or multiplication. See the enumerated constants for possible values.

Each operator has punctuation associated with it (e.g., ADD has "+" associated with it). Enum.toString() still returns the raw name (e.g., "ADD" ); use getPunctuation() to get the punctuation. convertPunctuation(String) can be used to turn punctuation (like "+") into an OperatorETIR.Operator.

Author:
Jeremy D. Frens

Enum Constant Summary
ADD
           
AND
           
DIVIDE
           
EQUALS
           
GREATER_EQUALS
           
GREATER_THAN
           
LESS_EQUALS
           
LESS_THAN
           
MODULUS
           
MULTIPLY
           
NOT_EQUALS
           
OR
           
SUBTRACT
           
 
Method Summary
static OperatorETIR.Operator convertPunctuation(java.lang.String punctuation)
          Converts the standard C/C++/Java punctuation strings into operators.
 java.lang.String getPunctuation()
          Gets the standard punctuation for the operator.
static OperatorETIR.Operator valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static OperatorETIR.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, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

ADD

public static final OperatorETIR.Operator ADD

SUBTRACT

public static final OperatorETIR.Operator SUBTRACT

MULTIPLY

public static final OperatorETIR.Operator MULTIPLY

DIVIDE

public static final OperatorETIR.Operator DIVIDE

MODULUS

public static final OperatorETIR.Operator MODULUS

EQUALS

public static final OperatorETIR.Operator EQUALS

NOT_EQUALS

public static final OperatorETIR.Operator NOT_EQUALS

LESS_THAN

public static final OperatorETIR.Operator LESS_THAN

LESS_EQUALS

public static final OperatorETIR.Operator LESS_EQUALS

GREATER_EQUALS

public static final OperatorETIR.Operator GREATER_EQUALS

GREATER_THAN

public static final OperatorETIR.Operator GREATER_THAN

AND

public static final OperatorETIR.Operator AND

OR

public static final OperatorETIR.Operator OR
Method Detail

values

public static OperatorETIR.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 (OperatorETIR.Operator c : OperatorETIR.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 OperatorETIR.Operator valueOf(java.lang.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:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

getPunctuation

public java.lang.String getPunctuation()
Gets the standard punctuation for the operator.

Specified by:
getPunctuation in interface IOperatorETIR.IOperator

convertPunctuation

public static OperatorETIR.Operator convertPunctuation(java.lang.String punctuation)
Converts the standard C/C++/Java punctuation strings into operators. For example, "+" becomes an ADD.

Parameters:
punctuation - the punctuation for the operator.
Returns:
the appropriate OperatorETIR.Operator.