Class PStack

All Implemented Interfaces:
Serializable, Cloneable, Iterable, Collection, List, RandomAccess

public class PStack extends ArrayList
PStack this class should be removed when a non thread safe stack is added to the java class libraries.

Version:
1.0
Author:
Jesse Grosjean
See Also:
  • Constructor Details

    • PStack

      public PStack()
      Creates an empty stack.
  • Method Details

    • push

      public void push(Object o)
      Pushes the provided object onto the top of the stack.
      Parameters:
      o - object to add to the stack
    • peek

      public Object peek()
      Returns topmost element on the stack, or null if stack is empty.
      Returns:
      topmost element on the stack, or null if empty
    • pop

      public Object pop()
      Removes top element on the stack and returns it.
      Returns:
      topmost element on stack.