Interface Stack<T>

All Known Implementing Classes:
ArrayStringStack

public interface Stack<T>
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Checks if the stack is empty.
    boolean
    Checks if the Stack is full.
    Take a look the top element without removing it.
    pop()
    Take the top element from the stack.
    void
    push(T element)
    Pushes an element on top of the stack.
    int
    Get the size of the Stack.
  • Method Details

    • size

      int size()
      Get the size of the Stack.
      Returns:
      the size of the Stack
    • peek

      T peek()
      Take a look the top element without removing it.
      Returns:
      the top element of the Stack
    • pop

      T pop()
      Take the top element from the stack.
      Returns:
      the top element of the stack
    • push

      void push(T element)
      Pushes an element on top of the stack.
      Parameters:
      element - to be pushed to the stack
    • isEmpty

      boolean isEmpty()
      Checks if the stack is empty.
      Returns:
      true if empty and false if not
    • isFull

      boolean isFull()
      Checks if the Stack is full.
      Returns:
      True if no element can be added anymore.