public abstract class SumType extends PostfixMathCommand implements CallbackEvaluationI
public abstract Object evaluate(Object elements[]) throws ParseException;method, which is passed an array of the value
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
name
The name of the function, use in error reporting.
|
curNumberOfParameters, numberOfParameters
Constructor and Description |
---|
SumType() |
SumType(java.lang.String funName) |
Modifier and Type | Method and Description |
---|---|
boolean |
checkNumberOfParameters(int n)
Checks the number of parameters of the function.
|
java.lang.Object |
evaluate(Node node,
EvaluatorI pv)
Evaluates the operator in given context.
|
java.lang.Object |
evaluate(Node node,
Variable var,
double min,
double max,
double inc,
EvaluatorI pv)
Evaluates the node by repeatibly setting the value of the variable from min to max, and calculating the value of the first argument.
|
abstract java.lang.Object |
evaluate(java.lang.Object[] elements)
Evaluates the function given the set of y values.
|
void |
run(java.util.Stack s)
run method.
|
checkStack, getNumberOfParameters, setCurNumberOfParameters
public boolean checkNumberOfParameters(int n)
PostfixMathCommand
checkNumberOfParameters
in interface PostfixMathCommandI
checkNumberOfParameters
in class PostfixMathCommand
n
- number of parameters function will be called with.public java.lang.Object evaluate(Node node, EvaluatorI pv) throws ParseException
evaluate
in interface CallbackEvaluationI
node
- The current nodepv
- The visitor, can be used evaluate the childrenParseException
public java.lang.Object evaluate(Node node, Variable var, double min, double max, double inc, EvaluatorI pv) throws ParseException
evaluate(Object[])
is more useful. If they do they should follow the pattern used here.node
- var
- min
- max
- inc
- pv
- ParseException
public abstract java.lang.Object evaluate(java.lang.Object[] elements) throws ParseException
elements
- the y valuesParseException
public void run(java.util.Stack s) throws ParseException
run
in interface PostfixMathCommandI
run
in class PostfixMathCommand
ParseException
http://www.singularsys.com/jep Copyright © 2007 Singular Systems