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 String |
name
The name of the function, use in error reporting.
|
curNumberOfParameters, numberOfParameters| Modifier and Type | Method and Description |
|---|---|
boolean |
checkNumberOfParameters(int n)
Checks the number of parameters of the function.
|
Object |
evaluate(Node node,
EvaluatorI pv)
Evaluates the operator in given context.
|
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 Object |
evaluate(Object[] elements)
Evaluates the function given the set of y values.
|
void |
run(Stack s)
run method.
|
checkStack, getNumberOfParameters, setCurNumberOfParametersprotected String name
public SumType(String funName)
public SumType()
public boolean checkNumberOfParameters(int n)
PostfixMathCommandcheckNumberOfParameters in interface PostfixMathCommandIcheckNumberOfParameters in class PostfixMathCommandn - number of parameters function will be called with.public Object evaluate(Node node, EvaluatorI pv) throws ParseException
evaluate in interface CallbackEvaluationInode - The current nodepv - The visitor, can be used evaluate the childrenParseExceptionpublic 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 - ParseExceptionpublic abstract Object evaluate(Object[] elements) throws ParseException
elements - the y valuesParseExceptionpublic void run(Stack s) throws ParseException
run in interface PostfixMathCommandIrun in class PostfixMathCommandParseExceptionCopyright © 2018. All rights reserved.