Class Stack<E>

Type Parameters:
E - a type of an element.
All Implemented Interfaces:
Serializable, Cloneable, Iterable<E>, Collection<E>, List<E>, RandomAccess
Direct Known Subclasses:
DictStack, ExecutionStack, OperandStack, ProcStack

public class Stack<E> extends ArrayList<E>
Base class for interpreter’s stacks.
See Also:
  • Constructor Details

    • Stack

      public Stack()
  • Method Details

    • pop

      public E pop()
      Pops and returns the topmost element of this stack.
      Returns:
      an element popped.
    • peek

      public E peek()
      Returns the topmost of this stack without popping it.
      Returns:
      an element.
    • push

      public void push(E element)
      Pushes an element to the stack.
      Parameters:
      element - an element.
    • setSize

      public void setSize(int size)