public final class NodeValue extends Node
NodeValue
class represents a node that stores a constant value.
The class serves as an adapter to allow Data to be used in an expression.Constructor and Description |
---|
NodeValue(Data data)
Creates a value syntax element based on a data object.
|
Modifier and Type | Method and Description |
---|---|
Node |
deepCopy()
Creates a deep copy of the current objects.
|
boolean |
equals(java.lang.Object obj) |
DataMap |
getArray()
Returns stored DataMap value and throws an exception if the stored value has a different type.
|
BitVector |
getBitVector()
Returns stored BitVector value and throws an exception if the stored value has a different type.
|
boolean |
getBoolean()
Returns stored boolean value and throws an exception if the stored value has a different type.
|
Data |
getData()
Returns the data object that encapsulates the value.
|
DataType |
getDataType()
Returns an object that describes the type of the value referred by the node.
|
java.math.BigInteger |
getInteger()
Returns stored BigInteger value and throws an exception if the stored value has a different type.
|
double |
getReal()
Returns stored Double value and throws an exception if the stored value has a different type.
|
java.lang.Object |
getValue()
Returns an object that stores a data value.
|
int |
hashCode() |
static NodeValue |
newBitVector(BitVector value)
Creates a new value node based on a bit vector.
|
static NodeValue |
newBoolean(boolean value)
Creates a new value node based on a boolean value.
|
static NodeValue |
newInteger(java.math.BigInteger value)
Creates a new value node based on a
BigInteger value. |
static NodeValue |
newInteger(int value)
Creates a new value node based on an integer value.
|
static NodeValue |
newInteger(java.lang.String text,
int radix)
Creates a new value node based on a textual representation of an integer value.
|
static NodeValue |
newReal(double value)
Creates a new value node based on a double value.
|
static NodeValue |
newUnknown(java.lang.Object value)
Creates a new value node based on a value of an unknown type.
|
void |
setData(Data data)
Changes the data value associated with the node.
|
java.lang.String |
toString() |
AND, getDataTypeId, getKind, getUserData, isType, isType, NOT, OR, setUserData
public NodeValue(Data data)
data
- A data object.java.lang.IllegalArgumentException
- if the argument is null
.public static NodeValue newInteger(int value)
public static NodeValue newInteger(java.math.BigInteger value)
BigInteger
value.public static NodeValue newInteger(java.lang.String text, int radix)
public static NodeValue newReal(double value)
public static NodeValue newBoolean(boolean value)
public static NodeValue newUnknown(java.lang.Object value)
public static NodeValue newBitVector(BitVector value)
public Node deepCopy()
public Data getData()
public void setData(Data data)
data
- New data value to be associated with the node.java.lang.IllegalArgumentException
- if the argument is null
.public java.lang.Object getValue()
public DataType getDataType()
getDataType
in class Node
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public java.math.BigInteger getInteger()
public BitVector getBitVector()
public boolean getBoolean()
public double getReal()
public DataMap getArray()