|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.graphbuilder.math.Expression
The class from which all nodes of an expression tree are descendents. Expressions can be evaluated using the eval method. Expressions that are or have FuncNodes or VarNodes as descendents must provide a VarMap or FuncMap respectively. Expressions that consist entirely of OpNodes and ValNodes do not require a VarMap or FuncMap. For Expressions that support children (OpNodes, FuncNodes), a child can only be accepted provided it currently has no parent, a cyclic reference is not formed, and it is non-null.
Field Summary | |
protected Expression |
parent
|
Constructor Summary | |
Expression()
|
Method Summary | |
protected void |
checkBeforeAccept(Expression x)
Protected method used to verify that the specified expression can be included as a child expression of this node. |
abstract double |
eval(VarMap v,
FuncMap f)
Returns the result of evaluating the expression tree rooted at this node. |
java.lang.String[] |
getFunctionNames()
Returns an array of exact length of the function names contained in the expression tree rooted at this node. |
Expression |
getParent()
Returns the parent of this node. |
java.lang.String[] |
getVariableNames()
Returns an array of exact length of the variable names contained in the expression tree rooted at this node. |
boolean |
isDescendent(Expression x)
Returns true if this node is a descendent of the specified node, false otherwise. |
java.lang.String |
toString()
Returns a string that represents the expression tree rooted at this node. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected Expression parent
Constructor Detail |
public Expression()
Method Detail |
public abstract double eval(VarMap v, FuncMap f)
public boolean isDescendent(Expression x)
public Expression getParent()
protected void checkBeforeAccept(Expression x)
java.lang.IllegalArgumentException
- If the specified expression is not accepted.public java.lang.String[] getVariableNames()
public java.lang.String[] getFunctionNames()
public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |