Class JepTest.Square

java.lang.Object
com.singularsys.jep.functions.PostfixMathCommand
com.singularsys.jeptests.system.JepTest.Square
All Implemented Interfaces:
PostfixMathCommandI, RealUnaryFunction, Serializable
Enclosing class:
JepTest

public static class JepTest.Square extends PostfixMathCommand implements RealUnaryFunction
Square of value
See Also:
  • Constructor Details

    • Square

      public Square()
  • Method Details

    • evaluate

      public double evaluate(double l)
      Description copied from interface: RealUnaryFunction
      Evaluate the function
      Specified by:
      evaluate in interface RealUnaryFunction
      Parameters:
      l - the argument
      Returns:
      the result of applying the function to the argument
    • run

      public void run(Stack<Object> s)
      Description copied from class: PostfixMathCommand
      Throws an exception because this method should never be called under normal circumstances. Each function should use its own run() method for evaluating the function. This includes popping off the parameters from the stack, and pushing the result back on the stack.
      Specified by:
      run in interface PostfixMathCommandI
      Overrides:
      run in class PostfixMathCommand
      Parameters:
      s - arguments for function