Package com.nt.udc.io

Class COSARExprRandom

java.lang.Object
com.nt.udc.io.COSARExpr
com.nt.udc.io.COSARExprRandom

public class COSARExprRandom extends COSARExpr
This class represents the operation returning a random number.
  • Field Details

    • m_valueInt

      protected COSARAttrInt m_valueInt
    • m_valueDouble

      protected COSARAttrDouble m_valueDouble
    • m_min

      protected COSARExpr m_min
      These members represent the operands.
    • m_max

      protected COSARExpr m_max
    • m_bGenInt

      protected boolean m_bGenInt
      This member is true if a random integer is to be returned, otherwise a random double is generated instead.
    • m_random

      protected Random m_random
      This member is the random number generator.
  • 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