Package com.singularsys.jep
Interface PostfixMathCommandI
-
- All Superinterfaces:
java.io.Serializable
- All Known Implementing Classes:
Abs
,AbstractInc
,Add
,Apply
,ArcCosine
,ArcCosineH
,ArcSine
,ArcSineH
,ArcTangent
,ArcTangent2
,ArcTanH
,Arg
,ArrayFunctionBase
,Assign
,Average
,BigDecAbs
,BigDecAdd
,BigDecDiv
,BigDecMod
,BigDecMul
,BigDecNegate
,BigDecPow
,BigDecRelational
,BigDecRound
,BigDecRoundSigFig
,BigDecSignum
,BigDecSub
,BigDecTieBreakComparative
,BinaryFunction
,Binomial
,BinomialCdf
,BinomialDist
,BitAnd
,BitComp
,BitOr
,BitXor
,BugsTest.StackMessingFunc
,Case
,Ceil
,Clean
,Coeffs
,Comparative
,Compare
,ComplexPFMC
,Concat
,Conjugate
,ConstantFunction
,Cosecant
,Cosine
,CosineH
,Cotangent
,Count
,Cross
,Define
,Diff
,DirtyRandom
,DirtyThreadSafeRandom
,Divide
,Dot
,Ele
,ElementMinMax
,ElementOf
,ElementProduct
,ElementSum
,Eval
,Exp
,Expand
,ExtensionsConsole.PrintfFunction
,ExtensionsConsole.PrintFunction
,ExtractEqn
,Factorial
,FieldAbs
,FieldBinomial
,FieldConsole.BigDecPFMC
,FieldConsole.DoublePFMC
,FieldConsole.RationalPFMC
,FieldFactorial
,FieldMod
,FieldPostDec
,FieldPostInc
,FieldPower
,FieldPreDec
,FieldPreInc
,FieldRange
,FieldSignum
,FieldSqrt
,Filter
,Floor
,Fold
,FromBase
,Identity
,If
,Imaginary
,IsInfinite
,IsNaN
,IsNull
,IsType
,Iterate
,JepTest.AddFractionsNary
,JepTest.AddFractionsStack
,JepTest.Diff
,JepTest.MyBinary
,JepTest.MyNary
,JepTest.MyNaryBinary
,JepTest.MyNullary
,JepTest.MyUnary
,JepTest.PiFun
,JepTest.Product
,JepTest.Square
,LambdaFunction
,LambdaFunGenerator
,LazyLogical
,Left
,Length
,LightWeightComponentSetTest.NonThreadSafeFunction
,LightWeightComponentSetTest.NonThreadSafeOpFunction
,List
,ListReturningFunction
,Logarithm
,LogBase2
,Logical
,LogTwoArg
,LowerCase
,LShift
,MacroFunction
,Map
,MatrixAdd
,MatrixCmp
,MatrixCross
,MatrixDet
,MatrixDiv
,MatrixDot
,MatrixEle
,MatrixId
,MatrixInv
,MatrixList
,MatrixMod
,MatrixMul
,MatrixNeg
,MatrixPow
,MatrixSize
,MatrixSolve
,MatrixSub
,MatrixTrace
,MatrixTrans
,MatrixZeroMat
,MatrixZeroVec
,Mean
,Median
,Merge
,Mid
,MinMax
,Mode
,Modulus
,Multiply
,NaryBinaryFunction
,NaryFunction
,NaturalLogarithm
,NormalDist
,NormalInverse
,Not
,NullaryFunction
,NullSafeEquals
,NullWrappedAbstractInc
,NullWrappedBinary
,NullWrappedIf
,NullWrappedLazyLogical
,NullWrappedNary
,NullWrappedNaryBinary
,NullWrappedPfmc
,NullWrappedUnary
,OpEquals
,Percentile
,Polar
,PostDec
,PostfixMathCommand
,PostInc
,Power
,PreDec
,PreInc
,Preprocess
,Random
,Range
,Rank
,Ranks
,RationalRound
,Real
,Remainder
,Right
,RInt
,Round
,RoundSF
,RpTest.MyArcSin
,RShift
,Secant
,Signum
,Simplify
,Sine
,SineH
,Sort
,SortElements
,SquareRoot
,Str
,StrictNaturalLogarithm
,StructuredConsole.PrintfFunction
,StructuredConsole.PrintFunction
,Subst
,Substring
,Subtract
,Sum
,Switch
,SwitchDefault
,SymbolicEquals
,Tangent
,TanH
,TernaryConditional
,ThreadSafeAssign
,ThreadSafeEle
,ThreadSafeRandom
,ToBase
,Trim
,UMinus
,UnaryFunction
,UpperCase
,URShift
,Variance
,VSum
,XAssign
public interface PostfixMathCommandI extends java.io.Serializable
All function classes must implement this interface to ensure that the run() method is implemented.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
checkNumberOfParameters(int n)
Checks the number of parameters of the function.java.lang.String
getName()
The name of the function used in error messagesint
getNumberOfParameters()
Returns the number of required parameters, or -1 if any number of parameters is allowed.void
run(java.util.Stack<java.lang.Object> stack)
Run the function on the stack.void
setCurNumberOfParameters(int n)
Sets the number of current number of parameters used in the next call of run().void
setName(java.lang.String name)
Sets the name of the function used for error messages
-
-
-
Method Detail
-
run
void run(java.util.Stack<java.lang.Object> stack) throws EvaluationException
Run the function on the stack. Pops the arguments from the stack, and pushes the result on the top of the stack.- Parameters:
stack
- arguments for function- Throws:
EvaluationException
- if function cannot be evaluated
-
getNumberOfParameters
int getNumberOfParameters()
Returns the number of required parameters, or -1 if any number of parameters is allowed.- Returns:
- allowable number of parameters, -1 if a variable number is allowed
-
setCurNumberOfParameters
void setCurNumberOfParameters(int n)
Sets the number of current number of parameters used in the next call of run(). This method is only called when the reqNumberOfParameters is -1.- Parameters:
n
- number of parameter for next call of function
-
checkNumberOfParameters
boolean checkNumberOfParameters(int n)
Checks the number of parameters of the function. This method is called during the parsing of the equation to check syntax. Functions which set numberOfParameter=-1 should overwrite this method.- Parameters:
n
- number of parameters function will be called with.- Returns:
- False if an illegal number of parameters is supplied, true otherwise.
-
getName
java.lang.String getName()
The name of the function used in error messages- Returns:
- the function name
-
setName
void setName(java.lang.String name)
Sets the name of the function used for error messages- Parameters:
name
- the function name
-
-