pascalinterpreter.operators
Class Relational

java.lang.Object
  extended bypascalinterpreter.Operator
      extended bypascalinterpreter.BinaryOperator
          extended bypascalinterpreter.operators.Relational
Direct Known Subclasses:
Equal, Greater, GreaterEqual, Less, LessEqual, NotEqual

public abstract class Relational
extends BinaryOperator


Field Summary
 
Fields inherited from class pascalinterpreter.Operator
OP_REG_VAR_NAME
 
Constructor Summary
Relational()
           
 
Method Summary
 void execute(Variable operandL, Variable operandR)
           
protected abstract  boolean isTrue(double opL, double opR)
          Metoda dokonuje sprawdzenia prawdziwości operatora, na parametrach typu double.
 
Methods inherited from class pascalinterpreter.BinaryOperator
execInitialize, isPossible, makeConversion, parseDouble
 
Methods inherited from class pascalinterpreter.Operator
getRegistry, setRegistry, setRegistry, setRegistry, setRegistry
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Relational

public Relational()
Method Detail

execute

public void execute(Variable operandL,
                    Variable operandR)
             throws InternalException,
                    RuntimeException
Specified by:
execute in class BinaryOperator
Throws:
InternalException
RuntimeException

isTrue

protected abstract boolean isTrue(double opL,
                                  double opR)
Metoda dokonuje sprawdzenia prawdziwości operatora, na parametrach typu double. Ponieważ założono, że za wyjątkiem operatorów Equal i NotEqual, porównywane mogą być tylko liczby, to typ double jest wystarczającym.

Parameters:
opL - - operand lewy.
opR - - operand prawy.
Returns:
True, jeżeli prawda - jeśli nie, to false.