Queue

A manager for ordening values and iterating over them.

To create a new Queue instance, initialise the class like below.

const DQ = new QDB.Queue(Iterable?);

Properties

.Values

Private

Main structure holding the Queue values.
Type - Array

.Size

Current size of this Queue.
Type - Number

Methods

.Add(Value)

Adds a new entry to the Queue.

Parameter Type Description
Value Any Value to be added to the Queue.

Returns - Number
The new size of the Queue.

.Remove(Idx)

Removes an element from the Queue.

Parameter Type Description
Idx Number Index of the entry of this Queue.

Returns - Number
The new size of the Queue.

.Iterate(fn, Iterable?)

Iterates over this Queue.

Parameter Type Description
fn Function Function to execute per entry on this Queue.
Iterable Object Optional initial values for the cache of this iterate.

Returns - Cache
Secondary cache of this iterate.