|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.singularsys.jep.functions.PostfixMathCommand com.singularsys.jep.functions.NaryFunction
public abstract class NaryFunction
Convenient base class for nary functions.
Defines an Object eval(Object[] args)
method for calculating the result.
Field Summary |
---|
Fields inherited from class com.singularsys.jep.functions.PostfixMathCommand |
---|
curNumberOfParameters, name, NaN, numberOfParameters |
Constructor Summary | |
---|---|
NaryFunction()
Standard constructor where any number of arguments is allowed. |
|
NaryFunction(int nArgs)
Constructor where a fixed number of arguments is allowed |
Method Summary | |
---|---|
abstract java.lang.Object |
eval(java.lang.Object[] args)
Evaluate the function |
void |
run(java.util.Stack<java.lang.Object> stack)
Creates an array of object then calls eval(Object[]) |
Methods inherited from class com.singularsys.jep.functions.PostfixMathCommand |
---|
asArray, asBool, asDouble, asInt, asLong, asStrictInt, asString, checkNumberOfParameters, checkStack, getName, getNumberOfParameters, setCurNumberOfParameters, setName, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NaryFunction()
public NaryFunction(int nArgs)
nArgs
- number of arguments allowedMethod Detail |
---|
public void run(java.util.Stack<java.lang.Object> stack) throws EvaluationException
eval(Object[])
EvaluationException
public abstract java.lang.Object eval(java.lang.Object[] args) throws EvaluationException
args
- arguments to the function
EvaluationException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |