Queue

Queue

A Queue is an Array subclass that implements First In, First Out ordering

Constructor

new Queue()

Source:

Extends

  • Array

Members

dequeue

Source:
Get the front element of the queue and removes it from the queue.

enqueue

Source:
Push an object in to the queue.

Methods

clear()

Source:
Clear the contents of the queue.

hasNext() → {boolean}

Source:
Checks if the queue isn't empty.
Returns:
Whether or not the queue has another element. True if yes.
Type
boolean

isEmpty() → {boolean}

Source:
Checks if the queue is empty.
Returns:
Whether or not the queue is empty. True if yes.
Type
boolean

peek() → {object}

Source:
Get the front element of the queue without removing it from the queue.
Returns:
Front element from the queue.
Type
object

size() → {number}

Source:
Get the number of objects in the queue.
Returns:
Number of elements in the queue.
Type
number