pascalinterpreter
Class BinaryOperation

java.lang.Object
  extended bypascalinterpreter.Command
      extended bypascalinterpreter.Operation
          extended bypascalinterpreter.BinaryOperation

public class BinaryOperation
extends Operation


Field Summary
private  BinaryOperator operator
           
private  Variable secondOperand
           
 
Fields inherited from class pascalinterpreter.Operation
operand
 
Constructor Summary
BinaryOperation(Variable operandL, BinaryOperator operator, Variable operandR)
           
 
Method Summary
private  void checkOperator(Variable operandL, BinaryOperator operator, Variable operandR)
          Metoda sprawdza, czy operator będzie mógł pracować z tego typu zmiennymi.
 void execute()
          Metoda rozpoczyna wykonywanie komendy.
protected  BinaryOperator getOperator()
           
protected  Variable getSecondOperand()
           
 
Methods inherited from class pascalinterpreter.Operation
checkType, getOperand
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

operator

private BinaryOperator operator

secondOperand

private Variable secondOperand
Constructor Detail

BinaryOperation

public BinaryOperation(Variable operandL,
                       BinaryOperator operator,
                       Variable operandR)
                throws InternalException,
                       AnalyseException
See Also:
Object.Object()
Method Detail

getSecondOperand

protected Variable getSecondOperand()
Returns:

getOperator

protected BinaryOperator getOperator()
Returns:

execute

public void execute()
             throws RuntimeException,
                    InternalException
Description copied from class: Command
Metoda rozpoczyna wykonywanie komendy.

Specified by:
execute in class Command
Throws:
RuntimeException - - wyjątek generowany
InternalException

checkOperator

private void checkOperator(Variable operandL,
                           BinaryOperator operator,
                           Variable operandR)
                    throws AnalyseException
Metoda sprawdza, czy operator będzie mógł pracować z tego typu zmiennymi.

Parameters:
operandL - - operand lewy.
operator - - operator.
operandR - - operand prawy.
Throws:
AnalyseException - Wyjątek generowany, jeżeli operator nie może pracować ze zmiennymi tych typów.