public final class NodeVariable extends Node
Constructor and Description |
---|
NodeVariable(java.lang.String name,
DataType type)
Constructs a node for an uninitialized variable of the specified type.
|
NodeVariable(Variable variable)
Creates a node based on a Variable object.
|
Modifier and Type | Method and Description |
---|---|
Node |
deepCopy()
Creates a deep copy of the current objects.
|
boolean |
equals(java.lang.Object obj) |
Data |
getData()
Returns the data object that encapsulates the variable value.
|
DataType |
getDataType()
Returns an object that describes the type of the value referred by the node.
|
java.lang.String |
getName()
Returns the name of the variable.
|
java.lang.Object |
getValue()
Returns an object that stores a data value if any value was assigned to the variable (it is a
known variable) or null if it is an unknown variable.
|
Variable |
getVariable()
Returns the variable associated with the node.
|
int |
hashCode() |
static NodeVariable |
newBitVector(java.lang.String name,
int size)
Creates a new bit vector variable.
|
static NodeVariable |
newBoolean(java.lang.String name)
Creates a new boolean variable.
|
static NodeVariable |
newInteger(java.lang.String name)
Creates a new integer variable.
|
static NodeVariable |
newMap(java.lang.String name,
DataType keyType,
DataType valueType)
Creates a map-based variable.
|
static NodeVariable |
newReal(java.lang.String name)
Creates a new real variable.
|
static NodeVariable |
newString(java.lang.String name)
Creates a new string variable.
|
static NodeVariable |
newUnknown(java.lang.String name)
Creates a new variable of unknown type.
|
void |
setData(Data data)
Assigns new data value to the variable.
|
java.lang.String |
toString() |
AND, getDataTypeId, getKind, getUserData, isType, isType, NOT, OR, setUserData
public NodeVariable(java.lang.String name, DataType type)
null
.name
- Variable name.type
- Variable type.java.lang.IllegalArgumentException
- if any of the arguments is null
.public NodeVariable(Variable variable)
variable
- A variable node object.java.lang.IllegalArgumentException
- if the argument is null
.public static NodeVariable newInteger(java.lang.String name)
public static NodeVariable newReal(java.lang.String name)
public static NodeVariable newString(java.lang.String name)
public static NodeVariable newBoolean(java.lang.String name)
public static NodeVariable newUnknown(java.lang.String name)
public static NodeVariable newBitVector(java.lang.String name, int size)
public static NodeVariable newMap(java.lang.String name, DataType keyType, DataType valueType)
public Node deepCopy()
public Variable getVariable()
public java.lang.String getName()
public Data getData()
public void setData(Data data)
data
- Data value to be assigned to the variable.java.lang.IllegalArgumentException
- if the argument is null
.public java.lang.Object getValue()
DataTypeId
enumeration for details on internal representation
of data objectspublic 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