A node of an expression tree that represents a value. More...
Public Member Functions | |
ValNode (double d) | |
double | eval (VarMap v, FuncMap f) |
Returns the value. | |
double | getValue () |
void | setValue (double d) |
boolean | isDescendent (Expression x) |
Returns true if this node is a descendent of the specified node, false otherwise. | |
Expression | getParent () |
Returns the parent of this node. | |
String[] | getVariableNames () |
Returns an array of exact length of the variable names contained in the expression tree rooted at this node. | |
String[] | getFunctionNames () |
Returns an array of exact length of the function names contained in the expression tree rooted at this node. | |
String | toString () |
Returns a string that represents the expression tree rooted at this node. | |
Protected Member Functions | |
void | checkBeforeAccept (Expression x) |
Protected method used to verify that the specified expression can be included as a child expression of this node. | |
Protected Attributes | |
double | val = 0.0 |
Expression | parent = null |
A node of an expression tree that represents a value.
A ValNode cannot have any children.
Definition at line 6 of file ValNode.java.
com.graphbuilder.math.ValNode.ValNode | ( | double | d | ) |
Definition at line 10 of file ValNode.java.
References com.graphbuilder.math.ValNode.val.
void com.graphbuilder.math.Expression.checkBeforeAccept | ( | Expression | x | ) | [protected, inherited] |
Protected method used to verify that the specified expression can be included as a child expression of this node.
IllegalArgumentException | If the specified expression is not accepted. |
Definition at line 51 of file Expression.java.
References com.graphbuilder.math.Expression.isDescendent(), and com.graphbuilder.math.Expression.parent.
Referenced by com.graphbuilder.math.FuncNode.insert(), com.graphbuilder.math.OpNode.setLeftChild(), and com.graphbuilder.math.OpNode.setRightChild().
Returns the value.
Implements com.graphbuilder.math.Expression.
Definition at line 17 of file ValNode.java.
References com.graphbuilder.math.ValNode.val.
String [] com.graphbuilder.math.Expression.getFunctionNames | ( | ) | [inherited] |
Returns an array of exact length of the function names contained in the expression tree rooted at this node.
Definition at line 72 of file Expression.java.
References com.graphbuilder.math.Expression.getTermNames().
Expression com.graphbuilder.math.Expression.getParent | ( | ) | [inherited] |
Returns the parent of this node.
Definition at line 41 of file Expression.java.
References com.graphbuilder.math.Expression.parent.
double com.graphbuilder.math.ValNode.getValue | ( | ) |
Definition at line 21 of file ValNode.java.
References com.graphbuilder.math.ValNode.val.
String [] com.graphbuilder.math.Expression.getVariableNames | ( | ) | [inherited] |
Returns an array of exact length of the variable names contained in the expression tree rooted at this node.
Definition at line 65 of file Expression.java.
References com.graphbuilder.math.Expression.getTermNames().
boolean com.graphbuilder.math.Expression.isDescendent | ( | Expression | x | ) | [inherited] |
Returns true if this node is a descendent of the specified node, false otherwise.
By this methods definition, a node is a descendent of itself.
Definition at line 26 of file Expression.java.
References com.graphbuilder.math.Expression.parent.
Referenced by com.graphbuilder.math.Expression.checkBeforeAccept().
void com.graphbuilder.math.ValNode.setValue | ( | double | d | ) |
Definition at line 25 of file ValNode.java.
References com.graphbuilder.math.ValNode.val.
String com.graphbuilder.math.Expression.toString | ( | ) | [inherited] |
Returns a string that represents the expression tree rooted at this node.
Definition at line 114 of file Expression.java.
Referenced by edu.rice.cs.hpc.viewer.metric.ExtDerivedMetricDlg.createDialogArea(), and com.graphbuilder.math.Expression.toString().
Expression com.graphbuilder.math.Expression.parent = null [protected, inherited] |
Definition at line 15 of file Expression.java.
Referenced by com.graphbuilder.math.Expression.checkBeforeAccept(), com.graphbuilder.math.Expression.getParent(), com.graphbuilder.math.FuncNode.insert(), com.graphbuilder.math.Expression.isDescendent(), com.graphbuilder.math.OpNode.setLeftChild(), and com.graphbuilder.math.OpNode.setRightChild().
double com.graphbuilder.math.ValNode.val = 0.0 [protected] |
Definition at line 8 of file ValNode.java.
Referenced by com.graphbuilder.math.ValNode.eval(), com.graphbuilder.math.ValNode.getValue(), com.graphbuilder.math.ValNode.setValue(), and com.graphbuilder.math.ValNode.ValNode().