Class CircularLinkedQueue<T>

java.lang.Object
CircularLinkedQueue<T>
All Implemented Interfaces:
QueueInterface<T>

public class CircularLinkedQueue<T> extends Object implements QueueInterface<T>
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    class 
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Removes all entries from the queue.
    Removes and returns the element at the front of the queue.
    void
    enqueue(T element)
    Adds a new entry to the back of this queue.
    Retrieves the element at the front of this queue.
    boolean
    Determines if there are any elements in the queue.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CircularLinkedQueue

      public CircularLinkedQueue()
  • Method Details

    • enqueue

      public void enqueue(T element)
      Description copied from interface: QueueInterface
      Adds a new entry to the back of this queue.
      Specified by:
      enqueue in interface QueueInterface<T>
      Parameters:
      element - element to be added to the queue
    • getFront

      public T getFront()
      Description copied from interface: QueueInterface
      Retrieves the element at the front of this queue. The size of the queue is not changed.
      Specified by:
      getFront in interface QueueInterface<T>
      Returns:
      The element at the front of the queue.
    • dequeue

      public T dequeue()
      Description copied from interface: QueueInterface
      Removes and returns the element at the front of the queue. The size of the queue is decreased by one.
      Specified by:
      dequeue in interface QueueInterface<T>
      Returns:
      The element at the front of the queue
    • isEmpty

      public boolean isEmpty()
      Description copied from interface: QueueInterface
      Determines if there are any elements in the queue.
      Specified by:
      isEmpty in interface QueueInterface<T>
      Returns:
      True if the queue is empty.
    • clear

      public void clear()
      Description copied from interface: QueueInterface
      Removes all entries from the queue.
      Specified by:
      clear in interface QueueInterface<T>