Class Expression

java.lang.Object
com.sun.tools.corba.se.idl.constExpr.Expression
Direct Known Subclasses:
BinaryExpr, Terminal, UnaryExpr

public abstract class Expression extends Object
  • Field Details

  • Constructor Details

    • Expression

      public Expression()
  • Method Details

    • evaluate

      public abstract Object evaluate() throws EvaluationException
      Compute the value of this expression.
      Throws:
      EvaluationException
    • value

      public void value(Object value)
      Set the value of this expression.
    • value

      public Object value()
      Get the value of this expression.
    • rep

      public void rep(String rep)
      Set the representation of this expression.
    • rep

      public String rep()
      Get the representation of this expression.
    • type

      public void type(String type)
      Set the target type of this expression.
    • type

      public String type()
      Get the target type of this expression.
    • defaultType

      protected static String defaultType(String targetType)
      Return the default computation type for the given target type.
    • coerceToTarget

      public Object coerceToTarget(Object obj)
      Coerces a number to the target type of this expression.
      Parameters:
      obj - The number to coerce.
      Returns:
      the value of number coerced to the (target) type of this expression.
    • toUnsignedTarget

      protected BigInteger toUnsignedTarget(BigInteger b)
      Coerces an integral value (BigInteger) to its corresponding unsigned representation, if the target type of this expression is unsigned.
      Parameters:
      b - The BigInteger to be coerced.
      Returns:
      the value of an integral type coerced to its corresponding unsigned integral type, if the target type of this expression is unsigned.
    • toSignedTarget

      protected BigInteger toSignedTarget(BigInteger b)
      Coerces an integral value (BigInteger) to its corresponding signed representation, if the target type of this expression is signed.
      Parameters:
      b - The BigInteger to be coerced.
      Returns:
      the value of an integral type coerced to its corresponding signed integral type, if the target type of this expression is signed.
    • toUnsigned

      protected BigInteger toUnsigned(BigInteger b)
      Return the unsigned value of a BigInteger.