public class Constant
extends java.lang.Object
Reference.| Modifier and Type | Class and Description |
|---|---|
static class |
Constant.Kind
The kind.
|
| Constructor and Description |
|---|
Constant(java.lang.Object value)
Create a new constant value.
|
| Modifier and Type | Method and Description |
|---|---|
java.math.BigInteger |
bigIntValue()
Get this constant's value as a big integer.
|
double |
doubleValue()
Get this constant's value as a double.
|
Constant.Kind |
getKind()
Get this constant's kind.
|
java.lang.Object |
getValue()
Get this constant's value.
|
boolean |
isNull()
Determine whether this constant represents a null value.
|
boolean |
isNumber()
Determine whether this constant's value can be treated as a
number.
|
boolean |
isReference()
Determine whether this constant's value is a reference.
|
boolean |
isString()
Determine whether this constant's value is a string.
|
boolean |
isTrue()
Determine whether this constant represents a boolean true value.
|
long |
longValue()
Get this constant's value as a long.
|
Reference |
refValue()
Get this constant's value as a reference.
|
java.lang.String |
stringValue()
Get this constant's value as a string.
|
public Constant(java.lang.Object value)
value - The value.java.lang.IllegalArgumentException - Signals an invalid value.public Constant.Kind getKind()
public boolean isNumber()
true if this constant's kind is an integer,
big integer, double, or character.public boolean isString()
true if this constant's value is a string.public boolean isReference()
true if this constant's value is a
reference.public java.lang.Object getValue()
public long longValue()
java.lang.IllegalStateException - Signals that this constant cannot
be converted to a long.public java.math.BigInteger bigIntValue()
java.lang.IllegalStateException - Signals that this constant cannot
be converted to a big integer.public double doubleValue()
java.lang.IllegalStateException - Signals that this constant cannot
be converted to a double.public Reference refValue()
java.lang.IllegalStateException - Signals that this constant is not a
reference.public java.lang.String stringValue()
java.lang.IllegalStateException - Signals that this constant is not a
string.public boolean isTrue()
true if this constant represents true.public boolean isNull()
true if this constant represents null.Copyright © 2014. All Rights Reserved.