|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.singularsys.jep.functions.PostfixMathCommand
public abstract class PostfixMathCommand
Function classes extend this class. It is an implementation of the PostfixMathCommandI interface.
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.
Field Summary | |
---|---|
protected int |
curNumberOfParameters
Number of parameters to be used for the next run() invocation. |
protected int |
numberOfParameters
Number of parameters a the function requires. |
Constructor Summary | |
---|---|
PostfixMathCommand()
Creates a new PostfixMathCommand class. |
|
PostfixMathCommand(int nParam)
Creates a new PostfixMathCommand class. |
Method Summary | |
---|---|
boolean |
checkNumberOfParameters(int n)
Checks the number of parameters of the function. |
protected void |
checkStack(java.util.Stack inStack)
Check whether the stack is not null, throw a EvaluationException if it is. |
int |
getNumberOfParameters()
Return the required number of parameters. |
void |
setCurNumberOfParameters(int n)
Sets the number of current number of parameters used in the next call of run(). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.singularsys.jep.PostfixMathCommandI |
---|
run |
Field Detail |
---|
protected int numberOfParameters
protected transient int curNumberOfParameters
Constructor Detail |
---|
public PostfixMathCommand()
public PostfixMathCommand(int nParam)
nParam
- number of parameters for the functionMethod Detail |
---|
protected void checkStack(java.util.Stack inStack) throws EvaluationException
EvaluationException
public int getNumberOfParameters()
getNumberOfParameters
in interface PostfixMathCommandI
public void setCurNumberOfParameters(int n)
setCurNumberOfParameters
in interface PostfixMathCommandI
public boolean checkNumberOfParameters(int n)
checkNumberOfParameters
in interface PostfixMathCommandI
n
- number of parameters function will be called with.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |