Class Expression

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

public abstract class Expression extends Object
  • Field Details

    • negOne

      public static final BigInteger negOne
    • zero

      public static final BigInteger zero
    • one

      public static final BigInteger one
    • two

      public static final BigInteger two
    • twoPow15

      public static final BigInteger twoPow15
    • twoPow16

      public static final BigInteger twoPow16
    • twoPow31

      public static final BigInteger twoPow31
    • twoPow32

      public static final BigInteger twoPow32
    • twoPow63

      public static final BigInteger twoPow63
    • twoPow64

      public static final BigInteger twoPow64
    • sMax

      public static final BigInteger sMax
    • sMin

      public static final BigInteger sMin
    • usMax

      public static final BigInteger usMax
    • usMin

      public static final BigInteger usMin
    • lMax

      public static final BigInteger lMax
    • lMin

      public static final BigInteger lMin
    • ulMax

      public static final BigInteger ulMax
    • ulMin

      public static final BigInteger ulMin
    • llMax

      public static final BigInteger llMax
    • llMin

      public static final BigInteger llMin
    • ullMax

      public static final BigInteger ullMax
    • ullMin

      public static final BigInteger ullMin
    • _value

      private Object _value
      Value of this expression: Boolean, Char, Byte, BigInteger, Double, String, Expression, ConstEntry.
    • _rep

      private String _rep
      String representation of this expression.
    • _type

      private String _type
      Computation type of this (sub)expression = Target type for now.
  • 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.