rdr.core
Class Operator

java.lang.Object
  extended by rdr.core.Operator
All Implemented Interfaces:
java.io.Serializable

public class Operator
extends java.lang.Object
implements java.io.Serializable

Operator class Defines the various comparison operators you can use in a condition

Author:
Ivan Bindoff
See Also:
Serialized Form

Constructor Summary
Operator(int op)
          Constructor
 
Method Summary
static Operator findOperator(java.lang.String str)
          Returns an Operator object in response to a string representation of one.
 int getOperator()
          Get the operator code
 java.lang.String getOperatorName()
          Get the "name" of the operator i.e.
 int getOpposite()
          Get the operator code for the opposite operator of this one i.e.
 void setOperator(int op)
          Set the operator code
 java.lang.String toString()
          Converts this operator into a readable string.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Operator

public Operator(int op)
Constructor

Parameters:
op - the operator code
Method Detail

getOperator

public int getOperator()
Get the operator code

Returns:
the operator code

getOperatorName

public java.lang.String getOperatorName()
Get the "name" of the operator i.e. Operator.EQUALS is named "=="

Returns:
name

setOperator

public void setOperator(int op)
Set the operator code

Parameters:
op - the operator code to use

getOpposite

public int getOpposite()
Get the operator code for the opposite operator of this one i.e. == returns !=, <= returns > etc.

Returns:
operator code

toString

public java.lang.String toString()
Converts this operator into a readable string.

Overrides:
toString in class java.lang.Object

findOperator

public static Operator findOperator(java.lang.String str)
Returns an Operator object in response to a string representation of one.

Parameters:
str - the string representation
Returns:
the correct Operator object