Class Expression
- java.lang.Object
-
- com.sun.tools.corba.ee.idl.constExpr.Expression
-
- Direct Known Subclasses:
BinaryExpr,Terminal,UnaryExpr
public abstract class Expression extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String_repString representation of this expression.private java.lang.String_typeComputation type of this (sub)expression = Target type for now.private java.lang.Object_valueValue of this expression: Boolean, Char, Byte, BigInteger, Double, String, Expression, ConstEntry.static java.math.BigIntegerllMaxstatic java.math.BigIntegerllMinstatic java.math.BigIntegerlMaxstatic java.math.BigIntegerlMinstatic java.math.BigIntegernegOnestatic java.math.BigIntegeronestatic java.math.BigIntegersMaxstatic java.math.BigIntegersMinstatic java.math.BigIntegertwostatic java.math.BigIntegertwoPow15static java.math.BigIntegertwoPow16static java.math.BigIntegertwoPow31static java.math.BigIntegertwoPow32static java.math.BigIntegertwoPow63static java.math.BigIntegertwoPow64static java.math.BigIntegerullMaxstatic java.math.BigIntegerullMinstatic java.math.BigIntegerulMaxstatic java.math.BigIntegerulMinstatic java.math.BigIntegerusMaxstatic java.math.BigIntegerusMinstatic java.math.BigIntegerzero
-
Constructor Summary
Constructors Constructor Description Expression()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectcoerceToTarget(java.lang.Object obj)Coerces a number to the target type of this expression.protected static java.lang.StringdefaultType(java.lang.String targetType)Return the default computation type for the given target type.abstract java.lang.Objectevaluate()Compute the value of this expression.java.lang.Stringrep()Get the representation of this expression.voidrep(java.lang.String rep)Set the representation of this expression.protected java.math.BigIntegertoSignedTarget(java.math.BigInteger b)Coerces an integral value (BigInteger) to its corresponding signed representation, if the target type of this expression is signed.protected java.math.BigIntegertoUnsigned(java.math.BigInteger b)Return the unsigned value of a BigInteger.protected java.math.BigIntegertoUnsignedTarget(java.math.BigInteger b)Coerces an integral value (BigInteger) to its corresponding unsigned representation, if the target type of this expression is unsigned.java.lang.Stringtype()Get the target type of this expression.voidtype(java.lang.String type)Set the target type of this expression.java.lang.Objectvalue()Get the value of this expression.voidvalue(java.lang.Object value)Set the value of this expression.
-
-
-
Field Detail
-
negOne
public static final java.math.BigInteger negOne
-
zero
public static final java.math.BigInteger zero
-
one
public static final java.math.BigInteger one
-
two
public static final java.math.BigInteger two
-
twoPow15
public static final java.math.BigInteger twoPow15
-
twoPow16
public static final java.math.BigInteger twoPow16
-
twoPow31
public static final java.math.BigInteger twoPow31
-
twoPow32
public static final java.math.BigInteger twoPow32
-
twoPow63
public static final java.math.BigInteger twoPow63
-
twoPow64
public static final java.math.BigInteger twoPow64
-
sMax
public static final java.math.BigInteger sMax
-
sMin
public static final java.math.BigInteger sMin
-
usMax
public static final java.math.BigInteger usMax
-
usMin
public static final java.math.BigInteger usMin
-
lMax
public static final java.math.BigInteger lMax
-
lMin
public static final java.math.BigInteger lMin
-
ulMax
public static final java.math.BigInteger ulMax
-
ulMin
public static final java.math.BigInteger ulMin
-
llMax
public static final java.math.BigInteger llMax
-
llMin
public static final java.math.BigInteger llMin
-
ullMax
public static final java.math.BigInteger ullMax
-
ullMin
public static final java.math.BigInteger ullMin
-
_value
private java.lang.Object _value
Value of this expression: Boolean, Char, Byte, BigInteger, Double, String, Expression, ConstEntry.
-
_rep
private java.lang.String _rep
String representation of this expression.
-
_type
private java.lang.String _type
Computation type of this (sub)expression = Target type for now.
-
-
Method Detail
-
evaluate
public abstract java.lang.Object evaluate() throws EvaluationExceptionCompute the value of this expression.- Throws:
EvaluationException
-
value
public void value(java.lang.Object value)
Set the value of this expression.
-
value
public java.lang.Object value()
Get the value of this expression.
-
rep
public void rep(java.lang.String rep)
Set the representation of this expression.
-
rep
public java.lang.String rep()
Get the representation of this expression.
-
type
public void type(java.lang.String type)
Set the target type of this expression.
-
type
public java.lang.String type()
Get the target type of this expression.
-
defaultType
protected static java.lang.String defaultType(java.lang.String targetType)
Return the default computation type for the given target type.
-
coerceToTarget
public java.lang.Object coerceToTarget(java.lang.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 java.math.BigInteger toUnsignedTarget(java.math.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 java.math.BigInteger toSignedTarget(java.math.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 java.math.BigInteger toUnsigned(java.math.BigInteger b)
Return the unsigned value of a BigInteger.
-
-