public abstract class Node
extends java.lang.Object
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 |
---|---|
static Node |
AND(Node left,
Node right)
Creates an expression by performing logic conjunction on two existing expressions.
|
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 type)
Checks whether the stored value has the specified type
(types are compared on the
DataType level). |
boolean |
isType(DataTypeId typeId)
Checks whether the expression has the specified type
(types are compared on the
DataTypeId level). |
static Node |
NOT(Node expr)
Creates a new expression by performing logical negation on an existing expression.
|
static Node |
OR(Node left,
Node right)
Creates a new expression by performing logic disjunction on two existing expressions.
|
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.NullPointerException
- if the parameter equals null.protected Node(Node node)
node
- Node object to be copied.java.lang.NullPointerException
- 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(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 void setUserData(java.lang.Object obj)
obj
- User data object.public final java.lang.Object getUserData()
public static Node AND(Node left, Node right)
left
- An existing expression.right
- An existing expression.public static Node OR(Node left, Node right)
left
- An existing expression.right
- An existing expression.