Package utilities

Interface QueueADT<E>

Type Parameters:
E - The type of elements in this queue
All Known Implementing Classes:
MyDLList

public interface QueueADT<E>
An interface representing the Queue Abstract Data Type.
  • Method Summary

    Modifier and Type
    Method
    Description
    Removes the element in the first position
    void
    enQueue(E element)
    Adds an element to the first position
    Returns the data in the first position
    boolean
    Returns true if this list contains no elements.
    int
    Returns the current element count in this queue.
  • Method Details

    • enQueue

      void enQueue(E element) throws NullPointerException
      Adds an element to the first position
      Parameters:
      element - The element to be added
      Throws:
      NullPointerException - If the element is null
    • deQueue

      E deQueue() throws NoSuchElementException
      Removes the element in the first position
      Returns:
      The head of this queue
      Throws:
      NoSuchElementException - If this queue is empty
    • front

      E front() throws NoSuchElementException
      Returns the data in the first position
      Returns:
      The head of this queue
      Throws:
      NoSuchElementException - if this queue is empty
    • isEmpty

      boolean isEmpty()
      Returns true if this list contains no elements.
      Returns:
      true if this list contains no elements.
    • size

      int size()
      Returns the current element count in this queue.
      Returns:
      The number of elements in this queue