public abstract class Node
extends java.lang.Object
Node
class is a base class for all kinds of classes describing nodes in an expression
tree. It includes declarations and implementations of methods common for all node kinds.Modifier and Type | Class and Description |
---|---|
static class |
Node.Kind
The
Node.Kind enumeration specifies the kind of an expression tree node. |
Modifier | Constructor and Description |
---|---|
protected |
Node(Node.Kind kind)
Creates a node of the specified kind.
|
protected |
Node(Node node)
Constructor for making copies.
|
Modifier and Type | Method and Description |
---|---|
abstract Node |
deepCopy()
Creates a deep copy of the current objects.
|
abstract DataType |
getDataType()
Returns an object that describes the type of the value referred by the node.
|
DataTypeId |
getDataTypeId()
Returns a data type identifier describing the type of the value referred by the node.
|
Node.Kind |
getKind()
Returns the identifier that specifies the kind of the node.
|
java.lang.Object |
getUserData()
Returns user data.
|
boolean |
isType(DataType... types)
Checks whether the expression has one of the specified types
(types are compared on the
DataType level). |
boolean |
isType(DataType type)
Checks whether the stored value has the specified type
(types are compared on the
DataType level). |
boolean |
isType(DataTypeId... typeIds)
Checks whether the expression has one of the specified types
(types are compared on the
DataTypeId level). |
boolean |
isType(DataTypeId typeId)
Checks whether the expression has the specified type
(types are compared on the
DataTypeId level). |
void |
setUserData(java.lang.Object obj)
Associates a user data object with the current node
|
protected Node(Node.Kind kind)
kind
- Node kind identifier.java.lang.IllegalArgumentException
- if the parameter equals null
.protected Node(Node node)
node
- Node object to be copied.java.lang.IllegalArgumentException
- if the parameter equals null
.public abstract Node deepCopy()
public final Node.Kind getKind()
public abstract DataType getDataType()
public final DataTypeId getDataTypeId()
public final boolean isType(DataTypeId typeId)
DataTypeId
level).typeId
- DataTypeId
object the data type is to be compared to.true
if the expression type matches the type specified by
the typeId
argument or false
otherwise.public final boolean isType(DataTypeId... typeIds)
DataTypeId
level).typeIds
- List of type identifiers (DataTypeId
objects) the expression type
is to be compared to.true
if the expression type matches one of the type identifiers specified
by the typeIds
argument or false
otherwise.java.lang.IllegalArgumentException
- if the type identifier collection is empty.public final boolean isType(DataType type)
DataType
level).type
- DataType
object the data type is to be compared to.true
if the expression type matches the type specified by
the type
argument or false
otherwise.public final boolean isType(DataType... types)
DataType
level).types
- List of types (DataType
objects) the expression type
is to be compared to.true
if the expression type matches one of the types specified by
the types
argument or false
otherwise.java.lang.IllegalArgumentException
- if the type collection is empty.public final void setUserData(java.lang.Object obj)
obj
- User data object.public final java.lang.Object getUserData()