de.cau.cs.kieler.krep.compiler.lustre
Enum Operator

java.lang.Object
  extended by java.lang.Enum<Operator>
      extended by de.cau.cs.kieler.krep.compiler.lustre.Operator
All Implemented Interfaces:
Serializable, Comparable<Operator>

public enum Operator
extends Enum<Operator>

Implement binary operators.

Rating yellow
(2010-02-05) review by cmot, msp, tam

Enum Constant Summary
ADD
          Add.
AND
          logical and.
DIV
          divide.
EQ
          equal.
GE
          greater than or equal.
GT
          greater than.
IMPL
          logical imply.
LE
          less than or equal.
LT
          less than.
MOD
          modulo operator.
MUL
          Multiply.
NEQ
          not equal.
OR
          logical or.
SUB
          Sub.
XOR
          logical exclusive or.
 
Method Summary
static int eval(int a1, int a2, Operator op)
          static evaluation.
 String toKlp()
           
 String toString()
           
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

ADD

public static final Operator ADD
Add.


SUB

public static final Operator SUB
Sub.


MUL

public static final Operator MUL
Multiply.


DIV

public static final Operator DIV
divide.


MOD

public static final Operator MOD
modulo operator.


AND

public static final Operator AND
logical and.


OR

public static final Operator OR
logical or.


XOR

public static final Operator XOR
logical exclusive or.


IMPL

public static final Operator IMPL
logical imply.


LT

public static final Operator LT
less than.


LE

public static final Operator LE
less than or equal.


EQ

public static final Operator EQ
equal.


GE

public static final Operator GE
greater than or equal.


GT

public static final Operator GT
greater than.


NEQ

public static final Operator NEQ
not equal.

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

toString

public String toString()
Overrides:
toString in class Enum<Operator>

toKlp

public String toKlp()
Returns:
Klp identifier for the operator.

eval

public static int eval(int a1,
                       int a2,
                       Operator op)
static evaluation.

Parameters:
a1 - first parameter
a2 - second parameter
op - operator to eval
Returns:
evaluation of the operator