Interface ObjectStack<E>

All Superinterfaces:
Stack
All Known Subinterfaces:
MutableObjectArray<E>, MutableObjectInPlaceArray<E>

public interface ObjectStack<E> extends Stack

Stack of some objects (non-primitive values).

Any class implementing this interface must contain non-primitive elements.

Author:
Daniel Alievsky
  • Method Details

    • pop

      E pop()
      Equivalent to Stack.popElement().
      Returns:
      the element at the top of this stack (it is removed from the stack by this method).
      Throws:
      EmptyStackException - if this stack is empty.
    • push

      void push(E value)
      Equivalent to pushElement(value).
      Parameters:
      value - to be added to the top of this stack.
      Throws:
      ArrayStoreException - if value is notan instance of the class of stack elements.
      TooLargeArrayException - if the resulting stack length is too large for this type of stacks.