com.singularsys.aa.manipulation
Class TreeUtil
java.lang.Object
com.singularsys.aa.manipulation.TreeUtil
public class TreeUtil
- extends java.lang.Object
Method Summary |
static void |
addNewChild(org.nfunk.jep.Node parent,
org.nfunk.jep.Node child)
|
static org.nfunk.jep.ASTConstant |
createConstantNode(double value)
|
static org.nfunk.jep.ASTConstant |
createConstantNode(java.lang.Object value)
|
static org.nfunk.jep.ASTFunNode |
createOperatorNode(int id)
|
static int |
getNodeId(org.nfunk.jep.Node n)
|
static boolean |
identical(org.nfunk.jep.Node ex1,
org.nfunk.jep.Node ex2)
Returns true, if the expressions identified by the first and second
parameters are equal. |
static void |
replaceChild(org.nfunk.jep.Node oldChild,
org.nfunk.jep.Node newChild)
Replaces the oldChild with newChild. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
addNewChild
public static void addNewChild(org.nfunk.jep.Node parent,
org.nfunk.jep.Node child)
replaceChild
public static void replaceChild(org.nfunk.jep.Node oldChild,
org.nfunk.jep.Node newChild)
- Replaces the oldChild with newChild. This includes searching
for the oldChild amoung the children of it's parent, and replacing it
with newChild. The parent member of newChild is also set appropriately.
The top node has an ASTStart node as parent
identical
public static boolean identical(org.nfunk.jep.Node ex1,
org.nfunk.jep.Node ex2)
- Returns true, if the expressions identified by the first and second
parameters are equal.
getNodeId
public static int getNodeId(org.nfunk.jep.Node n)
createOperatorNode
public static org.nfunk.jep.ASTFunNode createOperatorNode(int id)
createConstantNode
public static org.nfunk.jep.ASTConstant createConstantNode(java.lang.Object value)
createConstantNode
public static org.nfunk.jep.ASTConstant createConstantNode(double value)