Class comb.collections.Queue
Extends
comb.collections.Collection.
FIFO Data structure
Defined in: Queue.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Field Attributes | Field Name and Description |
---|---|
the current number of elements in this queue
|
|
true if this queue is empty
|
|
a copy of the values contained in this queue
|
Method Attributes | Method Name and Description |
---|---|
clear()
Removes all items from this queue
|
|
contains(obj)
Determine if this queue contains the element
|
|
dequeue()
Removes first item from the head of the queue
|
|
enqueue(data)
Add data to this queue
|
|
peek()
Retrieves the item at the head of the queue without removing it
|
|
remove(obj)
Removes an element from this queue.
|
- Methods borrowed from class comb.collections.Collection:
- concat, indexOf, join, lastIndexOf, slice, toString
Field Detail
{Number}
count
the current number of elements in this queue
{Boolean}
isEmpty
true if this queue is empty
{Array}
values
a copy of the values contained in this queue
Method Detail
clear()
Removes all items from this queue
{Boolean}
contains(obj)
Determine if this queue contains the element
- Parameters:
- {*} obj
- the object to find
- Returns:
- {Boolean} true if this queue contains the element
{*}
dequeue()
Removes first item from the head of the queue
- Returns:
- {*} The element removed from this queue. Returns undefined if the queue is empty.
enqueue(data)
Add data to this queue
- Parameters:
- {*} data
- element to add
{*}
peek()
Retrieves the item at the head of the queue without removing it
- Returns:
- {*} The element at the head of the queue. Returns undefined if the queue is empty.
{Boolean}
remove(obj)
Removes an element from this queue.
- Parameters:
- {*} obj
- the data to remove.
- Returns:
- {Boolean} true if the element was removed, false otherwise.