Class Expression
java.lang.Object
com.sun.tools.corba.ee.idl.constExpr.Expression
- Direct Known Subclasses:
BinaryExpr
,Terminal
,UnaryExpr
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String
String representation of this expression.private String
Computation type of this (sub)expression = Target type for now.private Object
Value of this expression: Boolean, Char, Byte, BigInteger, Double, String, Expression, ConstEntry.static final BigInteger
static final BigInteger
static final BigInteger
static final BigInteger
static final BigInteger
static final BigInteger
static final BigInteger
static final BigInteger
static final BigInteger
static final BigInteger
static final BigInteger
static final BigInteger
static final BigInteger
static final BigInteger
static final BigInteger
static final BigInteger
static final BigInteger
static final BigInteger
static final BigInteger
static final BigInteger
static final BigInteger
static final BigInteger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncoerceToTarget
(Object obj) Coerces a number to the target type of this expression.protected static String
defaultType
(String targetType) Return the default computation type for the given target type.abstract Object
evaluate()
Compute the value of this expression.rep()
Get the representation of this expression.void
Set the representation of this expression.protected BigInteger
Coerces an integral value (BigInteger) to its corresponding signed representation, if the target type of this expression is signed.protected BigInteger
Return the unsigned value of a BigInteger.protected BigInteger
Coerces an integral value (BigInteger) to its corresponding unsigned representation, if the target type of this expression is unsigned.type()
Get the target type of this expression.void
Set the target type of this expression.value()
Get the value of this expression.void
Set the value of this expression.
-
Field Details
-
negOne
-
zero
-
one
-
two
-
twoPow15
-
twoPow16
-
twoPow31
-
twoPow32
-
twoPow63
-
twoPow64
-
sMax
-
sMin
-
usMax
-
usMin
-
lMax
-
lMin
-
ulMax
-
ulMin
-
llMax
-
llMin
-
ullMax
-
ullMin
-
_value
Value of this expression: Boolean, Char, Byte, BigInteger, Double, String, Expression, ConstEntry. -
_rep
String representation of this expression. -
_type
Computation type of this (sub)expression = Target type for now.
-
-
Constructor Details
-
Expression
public Expression()
-
-
Method Details
-
evaluate
Compute the value of this expression.- Throws:
EvaluationException
-
value
Set the value of this expression. -
value
Get the value of this expression. -
rep
Set the representation of this expression. -
rep
Get the representation of this expression. -
type
Set the target type of this expression. -
type
Get the target type of this expression. -
defaultType
Return the default computation type for the given target type. -
coerceToTarget
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
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
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
Return the unsigned value of a BigInteger.
-