Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.singularsys.jep.functions
Class PostfixMathCommand

    java.lang.Object
      com.singularsys.jep.functions.PostfixMathCommand

All Implemented Interfaces:
  PostfixMathCommandI, java.io.Serializable

Direct Known Subclasses:
  Abs, Add, ArcCosine, ArcCosineH, ArcSine, ArcSineH, ArcTangent, ArcTangent2, ArcTanH, Arg, Assign, Average, BigDecAdd, BigDecDiv, BigDecMod, BigDecMul, BigDecNegate, BigDecPow, BigDecRelational, BigDecSub, Binomial, Ceil, Comparative, ComplexPFMC, Conjugate, Cosine, CosineH, Cross, Divide, Dot, Ele, Exp, ExtendedOperatorSet.Factorial, Floor, If, Imaginary, LazyLogical, List, Logarithm, LogBase2, Logical, MacroFunction, MinMax, Modulus, Multiply, NaturalLogarithm, Not, Polar, Power, Random, Real, Round, Sine, SineH, SquareRoot, Str, StrictNaturalLogarithm, Subtract, Sum, Tangent, TanH, UMinus

    public abstract class PostfixMathCommand

extends java.lang.Object
implements PostfixMathCommandI, java.io.Serializable

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.

See Also:
  Serialized Form

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

### numberOfParameters

    protected int numberOfParameters

  Number of parameters a the function requires. Initialize this value to -1 if any number of parameters should be allowed.

### curNumberOfParameters

    protected transient int curNumberOfParameters

  Number of parameters to be used for the next run() invocation. Applies only if the required umber of parameters is variable (numberOfParameters = -1).

Constructor Detail

### PostfixMathCommand

    public PostfixMathCommand()

  Creates a new PostfixMathCommand class.

### PostfixMathCommand

    public PostfixMathCommand(int nParam)

  Creates a new PostfixMathCommand class.

  Parameters:
    `nParam` - number of parameters for the function

Method Detail

### checkStack

    protected void checkStack(java.util.Stack inStack)
                       throws EvaluationException

  Check whether the stack is not null, throw a EvaluationException if it is.

  Throws:
    `EvaluationException`

### getNumberOfParameters

    public int getNumberOfParameters()

  Return the required number of parameters.

  Specified by:
    `getNumberOfParameters` in interface `PostfixMathCommandI`

### setCurNumberOfParameters

    public 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.

  Specified by:
    `setCurNumberOfParameters` in interface `PostfixMathCommandI`

### checkNumberOfParameters

    public boolean checkNumberOfParameters(int n)

  Checks the number of parameters of the function. Functions which set numberOfParameter=-1 should overload this method

  Specified by:
    `checkNumberOfParameters` in interface `PostfixMathCommandI`
  Parameters:
    `n` - number of parameters function will be called with.
  Returns:
    false if an illegal number of parameters is supplied, true otherwise.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2007 Singular Systems http://www.singularsys.com/jep