public class PostfixMathCommand extends Object implements PostfixMathCommandI, Serializable
It includes a numberOfParameters member, that is checked when parsing the expression. This member should be initialized to an appropriate value for all classes extending this class. If an arbitrary number of parameters should be allowed, initialize this member to -1.
| Constructor and Description |
|---|
PostfixMathCommand()
Creates a new PostfixMathCommand class.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkNumberOfParameters(int n)
Checks the number of parameters of the function.
|
int |
getNumberOfParameters()
Return the required number of parameters.
|
void |
run(Stack s)
Throws an exception because this method should never be called under
normal circumstances.
|
void |
setCurNumberOfParameters(int n)
Sets the number of current number of parameters used in the next call
of run().
|
public PostfixMathCommand()
public int getNumberOfParameters()
getNumberOfParameters in interface PostfixMathCommandIpublic void setCurNumberOfParameters(int n)
setCurNumberOfParameters in interface PostfixMathCommandIpublic boolean checkNumberOfParameters(int n)
checkNumberOfParameters in interface PostfixMathCommandIn - number of parameters function will be called with.public void run(Stack s) throws ParseException
run in interface PostfixMathCommandIParseExceptionJas4pp 1.5 © Java Analysis Studio for Particle Physics