Interface Stack

  • All Known Implementing Classes:
    DefaultStack

    public interface Stack
    A table that is a stack
    • Method Detail

      • push

        void push​(Stack.ValueAndType value)
        Pushes a value on the top of the stack so the stack grow.
        Parameters:
        value - the value to push to the stack
      • pop

        java.lang.Object pop()
        Pops the topmost value off the top of the stack so the stack shrinks.
        Returns:
        the value that is on the top of the stack
      • getValueAtIndex

        java.lang.Object getValueAtIndex​(int index)
        Get the value at an index
        Parameters:
        index - the index from bottom of the table
        Returns:
        value the new value
      • setValueAtIndex

        void setValueAtIndex​(int index,
                             java.lang.Object value)
        Set the value at an index
        Parameters:
        index - the index from bottom of the table
        value - the new value
      • getValueAndTypeAtIndex

        Stack.ValueAndType getValueAndTypeAtIndex​(int index)
        Get the value and type at an index
        Parameters:
        index - the index from bottom of the table
        Returns:
        value and type the new value
      • setValueAndTypeAtIndex

        void setValueAndTypeAtIndex​(int index,
                                    Stack.ValueAndType valueAndType)
        Set the value at an index
        Parameters:
        index - the index from bottom of the table
        valueAndType - the new value and type
      • getCount

        int getCount()
        Get the number of items on the stack
        Returns:
        the number of items
      • setCount

        void setCount​(int newCount)
        Reset the number of items on the stack. This is used when parameters are put on the stack before a call to a module and those parameters needs to be removed when the module returns. The new count must be less than or equal to the current number of items.
        Parameters:
        newCount - the new number of items