Returns collection backed by this queue. Iterations will be in FIFO order. Time complexity is O(1).
collection of elements from this queue.
Removes and returns the element on this queue that was least recently added.
the element on this queue that was least recently added.
Adds the element to this queue.
element the item to add.
queue with the added element.
Returns true
if this queue is empty.
true
if this queue is empty; false
otherwise
Returns the element least recently added to this queue.
the element least recently added to this queue.
Returns the number of elements in this queue.
the number of elements in this queue.
Returns a string representation of this queue.
the sequence of elements in FIFO order, separated by spaces.
Generated using TypeDoc
The
Queue
class represents a first-in-first-out (FIFO) queue of generic elements. It supports the usual enqueue and dequeue operations, along with methods for peeking at the first item, testing if the queue is empty, and iterating through the items in FIFO order.