Get/Set whether this queue has inverted priority or not. False: smallest values will be at the front of the queue. True: largest values will be at the front of the queue. False by default. Setting the value will cause the queue to be reordered.
Get/Set whether this queue has inverted priority or not. False: smallest values will be at the front of the queue. True: largest values will be at the front of the queue. False by default. Setting the value will cause the queue to be reordered.
Returns the size of the queue
The size of the queue.
Clear the queue.
Returns whether the item exists in the queue.
The element to search for.
True if the element is in the queue; false otherwise.
Removes and returns the item at the front of the queue
The item at the front of the queue.
Retrieve elements that match a query.
A callback that returns whether an element matches
The element if found; null otherwise.
Retrieve the element at a specified index. Throws an error if i is out of bounds.
The index of the target element
The element found at the specified index.
Returns the index of the item if it exists in the queue.
The element to search for.
The index of the element in the queue; -1 if it does not exist.
Adds a new item to the queue.
The item to be added to the queue. Must implement getKey() method.
Retrieve the element at the front of the queue.
The element at the front of the queue.
Removes and returns the item at the front of the queue
The item at the front of the queue.
Removes and returns the item at the front of the queue
The item at the front of the queue.
Adds a new item to the queue.
Remove the specified element from the queue.
Set whether this queue has inverted priority or not. False: smallest values will be at the front of the queue. True: largest values will be at the front of the queue. False by default. Setting the value will cause the queue to be reordered.
The value to set
Returns the size of the queue
The size of the queue.
Return all elements in the queue as a sorted array.
Used to update the queue when a element's priority has been changed. Assumes the element has already been inserted. Assumes you have updated the value on your own.
The element to update
Generated using TypeDoc
Extension of PriorityQueue. Enforces uniqueness of enqueued elements; attempts made to enqueue an element that is already in the queue will be ignored.
Elements must implement getKey() method