public class XAssign extends PostfixMathCommand implements CallbackEvaluationI, CommandVisitorI, JepComponent
curNumberOfParameters, name, NaN, numberOfParameters
Constructor and Description |
---|
XAssign()
Constructor using
Assign for the basic evaluation method. |
XAssign(boolean useEqn)
Constructor to suppress copying of equations
|
XAssign(CallbackEvaluationI root)
Decorator constructor using a specified function for evaluation.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
evaluate(Node node,
Evaluator pv)
Performs some special evaluation on the node.
|
JepComponent |
getLightWeightInstance()
Gets a light-weight instance suitable for using in multiple threads.
|
void |
init(Jep jep)
Initialize the component.
|
boolean |
isUseEquation()
Whether equations are used.
|
Node |
process(Node node,
Node[] children)
In the pre-process stage, set the equation of the lhs variable to the rhs equation.
|
void |
run(java.util.Stack<java.lang.Object> aStack)
Throws an exception because this method should never be called under
normal circumstances.
|
asArray, asBool, asDouble, asInt, asLong, asStrictInt, asString, checkNumberOfParameters, getName, getNumberOfParameters, setCurNumberOfParameters, setName, toString, toString
public XAssign()
Assign
for the basic evaluation method.public XAssign(boolean useEqn)
useEqn
- if false equations are never setpublic XAssign(CallbackEvaluationI root)
root
- function used for evaluationpublic Node process(Node node, Node[] children) throws ParseException
process
in interface CommandVisitorI
node
- top node of the treechildren
- the children of the node after they have been preprocessed.ParseException
public java.lang.Object evaluate(Node node, Evaluator pv) throws EvaluationException
CallbackEvaluationI
pv.eval(node.jjtGetChild(i))for each child. The SymbolTable is not passed as an argument. This is because it is better practice to get and set variable values by using node.getVar().setValue() rather that through the SymbolTable with requires a hashtable lookup.
evaluate
in interface CallbackEvaluationI
node
- The current nodepv
- The visitor, can be used evaluate the childrenEvaluationException
- if the calculation cannot be performedEvaluator
public void run(java.util.Stack<java.lang.Object> aStack) throws EvaluationException
PostfixMathCommand
run
in interface PostfixMathCommandI
run
in class PostfixMathCommand
aStack
- arguments for functionEvaluationException
- if function cannot be evaluatedpublic boolean isUseEquation()
public void init(Jep jep)
JepComponent
init
in interface JepComponent
jep
- the current Jep instancepublic JepComponent getLightWeightInstance()
JepComponent
getLightWeightInstance
in interface JepComponent
Copyright © 2018 Singular Systems http://www.singularsys.com/jep