Class IfNode
java.lang.Object
com.singularsys.jep.parser.SimpleNode
com.singularsys.extensions.structure.StructureNode
com.singularsys.extensions.structure.IfNode
- All Implemented Interfaces:
Node
A node representing an if statement.
- Author:
- rich
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.singularsys.jep.parser.Node
Node.HookKey -
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.singularsys.extensions.structure.StructureNode
getName, getOperator, getPFMC, getValue, getVar, testConditionMethods inherited from class com.singularsys.jep.parser.SimpleNode
childIterator, children, childrenAccept, dump, getChildren, getHook, getId, hookKeys, jjtAccept, jjtAddChild, jjtClose, jjtGetChild, jjtGetNumChildren, jjtGetParent, jjtOpen, jjtSetParent, removeHook, setHook, toString
-
Constructor Details
-
IfNode
Constructor- Parameters:
condition- expression giving the conditiontrueNode- expression evaluated if truefalseNode- expression evaluated if false, may be null.
-
-
Method Details
-
getCondition
-
getFalseNode
-
getTrueNode
-
eval
Evaluate the statement- Specified by:
evalin classStructureNode- Parameters:
ev- The evaluator theEvaluator.eval(com.singularsys.jep.parser.Node)can be used to evaluate children.- Returns:
- result trueNode or falseNode or null if condition is true and falseNode is not specified.
- Throws:
EvaluationException- if evaluation cannot be performed
-
toString
-