Package de.gebit.integrity.operations.standard.operands

## Class OperatorNode<LEFT,​RIGHT>

- java.lang.Object
- - de.gebit.integrity.operations.standard.operands.OperatorNode<LEFT,​RIGHT>

- Type Parameters:
    `LEFT` - the left argument
    `RIGHT` - the right argument
  Direct Known Subclasses:
    `AdditionNode`, `DivisionNode`, `ModuloNode`, `MultiplicationNode`, `StringConcatenationNode`, `SubtractionNode`

      public abstract class OperatorNode<LEFT,​RIGHT>
      extends Object

  Abstract base class for operator nodes. An operator node is a node in the AST built to evaluate `StandardOperation`s.
  Author:
    Rene Schneider - initial API and implementation

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `OperatorNode​(Operation anOperation, Object aLeftOperand, Object aRightOperand)` | Creates an instance.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `Object` | `evaluate()` | Evaluates the whole node.
    `protected abstract Object` | `evaluateInternal​(LEFT aLeftOperand, RIGHT aRightOperand)` | Must be implemented by subclasses to implement the actual evaluation of this node.
    `protected Object` | `getEvaluatedLeftOperand()` | Returns the left operand in an evaluated version.
    `protected 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,
                              Object aLeftOperand,
                              Object aRightOperand)

      Creates an instance.
      Parameters:
        `aLeftOperand` - the left operand
        `aRightOperand` - the right operand

  - ### Method Detail

    - #### getEvaluatedLeftOperand

          protected Object getEvaluatedLeftOperand()
                                            throws UnexecutableException

      Returns the left operand in an evaluated version.
      Returns:
        the result of the evaluation
      Throws:
        `UnexecutableException`

    - #### getEvaluatedRightOperand

          protected Object getEvaluatedRightOperand()
                                             throws UnexecutableException

      Returns the right operand in an evaluated version.
      Returns:
        the result of the evaluation
      Throws:
        `UnexecutableException`

    - #### evaluate

          public Object evaluate()
                          throws UnexecutableException

      Evaluates the whole node.
      Returns:
        the evaluation result
      Throws:
        `UnexecutableException`

    - #### evaluateInternal

          protected abstract 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`