Class OpNode

Direct Known Subclasses:
AddNode, DivNode, MultNode, PowNode, SubNode

public abstract class OpNode extends Expression
A node of an expression tree that has exactly 2 children, a left child and a right child. After the children are evaluated, a mathematical operation is applied and the result is returned.
  • Field Details

  • Constructor Details

  • Method Details

    • setLeftChild

      public void setLeftChild(Expression x)
    • setRightChild

      public void setRightChild(Expression x)
    • getLeftChild

      public Expression getLeftChild()
    • getRightChild

      public Expression getRightChild()
    • getSymbol

      public abstract String getSymbol()
      Returns the text symbol that represents the operation.