Class OperatorNode<LEFT,​RIGHT>

    • Constructor Summary

      Constructors 
      Constructor Description
      OperatorNode​(Operation anOperation, java.lang.Object aLeftOperand, java.lang.Object aRightOperand)
      Creates an instance.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object evaluate()
      Evaluates the whole node.
      protected abstract java.lang.Object evaluateInternal​(LEFT aLeftOperand, RIGHT aRightOperand)
      Must be implemented by subclasses to implement the actual evaluation of this node.
      protected java.lang.Object getEvaluatedLeftOperand()
      Returns the left operand in an evaluated version.
      protected java.lang.Object getEvaluatedRightOperand()
      Returns the right operand in an evaluated version.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • OperatorNode

        public OperatorNode​(Operation anOperation,
                            java.lang.Object aLeftOperand,
                            java.lang.Object aRightOperand)
        Creates an instance.
        Parameters:
        aLeftOperand - the left operand
        aRightOperand - the right operand
    • Method Detail

      • getEvaluatedLeftOperand

        protected java.lang.Object getEvaluatedLeftOperand()
                                                    throws UnexecutableException
        Returns the left operand in an evaluated version.
        Returns:
        the result of the evaluation
        Throws:
        UnexecutableException
      • getEvaluatedRightOperand

        protected java.lang.Object getEvaluatedRightOperand()
                                                     throws UnexecutableException
        Returns the right operand in an evaluated version.
        Returns:
        the result of the evaluation
        Throws:
        UnexecutableException
      • evaluateInternal

        protected abstract java.lang.Object evaluateInternal​(LEFT aLeftOperand,
                                                             RIGHT aRightOperand)
                                                      throws UnexecutableException
        Must be implemented by subclasses to implement the actual evaluation of this node. It will get evaluated and converted operands and needs to return the result of the evaluation.
        Parameters:
        aLeftOperand - the evaluated left operand
        aRightOperand - the evaluated right operand
        Returns:
        the result of the evaluation
        Throws:
        UnexecutableException