public final class NodeOperation extends Node
NodeOperation
class represents an expression node described by an operation
and operands.Constructor and Description |
---|
NodeOperation(T operation,
java.util.Collection<? extends Node> operands)
Creates an operation node that has a variable number of operands (from 0 to infinity)
packed into a collection.
|
NodeOperation(T operation,
DataType dataType,
java.util.Collection<? extends Node> operands)
Creates an operation node that has a variable number of operands (from 0 to infinity)
packed into a collection.
|
NodeOperation(T operation,
DataType dataType,
Node... operands)
Creates an operation node that has a variable number of operands (from 0 to infinity).
|
NodeOperation(T operation,
Node... operands)
Creates an operation node that has a variable number of operands (from 0 to infinity).
|
Modifier and Type | Method and Description |
---|---|
Node |
deepCopy()
Creates a deep copy of the current objects.
|
boolean |
equals(java.lang.Object obj) |
DataType |
getDataType()
Returns an object that describes the type of the value referred by the node.
|
Node |
getOperand(int index)
Returns an operand by its index.
|
int |
getOperandCount()
Returns the number of operands.
|
java.util.List<Node> |
getOperands()
Returns an unmodifiable list of operands.
|
java.lang.Enum<?> |
getOperationId()
Returns an operation identifier.
|
int |
hashCode() |
java.lang.String |
toString() |
getDataTypeId, getKind, getUserData, isType, isType, isType, isType, setUserData
public NodeOperation(T operation, Node... operands)
T
- Operation identifier type.operation
- Operation identifier.operands
- Array of expression operands.java.lang.IllegalArgumentException
- if any parameter (including every operand) is null
.public NodeOperation(T operation, DataType dataType, Node... operands)
T
- Operation identifier type.operation
- Operation identifier.operands
- Array of expression operands.dataType
- Data type associated with the expression or null
to rely
on automated type calculation.java.lang.IllegalArgumentException
- if any parameter (including every operand) is null
.public NodeOperation(T operation, java.util.Collection<? extends Node> operands)
T
- Operation identifier type.operation
- Operation identifier.operands
- Collection of expression operands.java.lang.IllegalArgumentException
- if any parameter (including every operand) is null
.public NodeOperation(T operation, DataType dataType, java.util.Collection<? extends Node> operands)
T
- Operation identifier type.operation
- Operation identifier.dataType
- Data type associated with the expression or null
to rely
on automated type calculation.operands
- Collection of expression operands.java.lang.IllegalArgumentException
- if any parameter (including every operand) is null
.public Node deepCopy()
Node
public int getOperandCount()
public Node getOperand(int index)
index
- Index of the operand.public java.util.List<Node> getOperands()
public java.lang.Enum<?> getOperationId()
public DataType getDataType()
Node
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