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() |
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.NullPointerException
- if any of the arguments is null
.public NodeVariable(Variable variable)
variable
- A variable node object.java.lang.NullPointerException
- if the argument is null
.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.NullPointerException
- 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