Returns true if queue is empty
Is queue full? Returns false if no capacity has been set
Number of items in queue
Returns front of queue (oldest item), or undefined if queue is empty
Adds event listener.
Events
Event name
Event handler
Returns the item at given rank (0 being front of queue)
Clears the queue
Dequeues the item with highest priority.
Dequeues the item with the lowest priority.
Enqueues (adds items to back of queue). If a capacity is set, not all items might be added.
How many items were added
Adds an item with a given priority
Item
Priority (higher numeric value means higher priority)
Protected
fireFire event
Type of event
Arguments for event
Protected
onCalled when all data is cleared
Protected
onProtected
onPeeks at the item with highest priority without removing it. undefined if queue is empty.
Peeks at the item with the lowest priority without removing it. undefined if queue is empty.
Remove event listener
Removes values that match predicate
.
Returns number of items removed.
Return a copy of the array
Simple priority queue implementation. Higher numbers mean higher priority.