Class BugsTest.StackMessingFunc

  • All Implemented Interfaces:
    PostfixMathCommandI, java.io.Serializable
    Enclosing class:
    BugsTest

    public static class BugsTest.StackMessingFunc
    extends PostfixMathCommand
    A function which can incorrectly read the stack. Last argument controls how many items to pop off the stack
    See Also:
    Serialized Form
    • Constructor Detail

      • StackMessingFunc

        public StackMessingFunc()
    • Method Detail

      • run

        public void run​(java.util.Stack<java.lang.Object> stack)
                 throws EvaluationException
        Description copied from class: PostfixMathCommand
        Throws an exception because this method should never be called under normal circumstances. Each function should use it's 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:
        stack - arguments for function
        Throws:
        EvaluationException - if function cannot be evaluated