|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jscience.ml.sbml.SBase
org.jscience.ml.sbml.SBaseId
org.jscience.ml.sbml.FunctionDefinition
org.jscience.ml.sbml.jep.function.PostfixMathCommand
public 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. |
| Fields inherited from class org.jscience.ml.sbml.SBaseId |
|---|
id, name |
| Constructor Summary | |
|---|---|
PostfixMathCommand(int numParameters)
Creates a new PostfixMathCommand class. |
|
| Method Summary | |
|---|---|
protected void |
checkStack(java.util.Stack inStack)
Check whether the stack is not null, throw an Exception if it is. |
int |
getNumberOfParameters()
Return the required number of parameters. |
void |
run(java.util.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(). |
void |
setNumberOfParameters(int n)
Convenience method for use with the parser to set the parameters if they have changed. |
| Methods inherited from class org.jscience.ml.sbml.FunctionDefinition |
|---|
getMath, setMath, toString |
| Methods inherited from class org.jscience.ml.sbml.SBaseId |
|---|
getId, getName, setId, setName |
| Methods inherited from class org.jscience.ml.sbml.SBase |
|---|
getAnnotations, getMetaid, getNotes, getRDF, printList, printShortForm, setMetaid, setRDF, setRDF |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected int curNumberOfParameters
protected int numberOfParameters
| Constructor Detail |
|---|
public PostfixMathCommand(int numParameters)
| Method Detail |
|---|
public int getNumberOfParameters()
getNumberOfParameters in interface PostfixMathCommandI
public void run(java.util.Stack s)
throws java.lang.Exception
run in interface PostfixMathCommandIs - DOCUMENT ME!
java.lang.Exception - DOCUMENT ME!public void setCurNumberOfParameters(int n)
setCurNumberOfParameters in interface PostfixMathCommandIn - DOCUMENT ME!public void setNumberOfParameters(int n)
protected void checkStack(java.util.Stack inStack)
throws java.lang.Exception
java.lang.Exception
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||