Package com.nt.udc.io

Class COSARExprBinaryNumOp

java.lang.Object
com.nt.udc.io.COSARExpr
com.nt.udc.io.COSARExprBinaryNumOp
Direct Known Subclasses:
COSARExprDivide, COSARExprMinus, COSARExprMultiply, COSARExprPlus, COSARExprPower

public abstract class COSARExprBinaryNumOp extends COSARExpr
This class represents a binary numeric operation.
  • Field Details

    • m_left

      protected COSARExpr m_left
      This member represents the left operand.
    • m_right

      protected COSARExpr m_right
      This member represents the right operand.
  • Constructor Details

  • Method Details

    • eval

      public COSARAttr eval(HashMap symbols) throws Exception
      Description copied from class: COSARExpr
      This function is used to evaluate the expression. A symbol table is passed to help in retrieving the value of referenced symbols. The HashMap should contain values stored as COSARAttr objects, keyed by their associated symbol's name.
      Overrides:
      eval in class COSARExpr
      Returns:
      The expression's value
      Throws:
      Exception
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns:
      A string representation of the OSAR expression
    • getComputedValue

      protected abstract double getComputedValue(double val1, double val2)
      This function does the actual computation.
    • getOpString

      protected abstract String getOpString()
      This function returns a string representation of the operation.