| Methods |
|---|
Constructor
new PriorityQueue()
- Source:
Methods
clear()
Removes all elements from the heap.
- Source:
clone() → (non-null) {OpenSeadragon.PriorityQueue}
Clones a heap and returns a new heap
- Source:
Returns:
A new Heap with the same key-value pairs.
containsKey(key) → {boolean}
Whether the heap contains the given key.
Parameters:
| Name | Type | Description |
|---|---|---|
key |
string | The key to check for. |
- Source:
Returns:
Whether the heap contains the key.
- Type
- boolean
containsValue(val) → {boolean}
Whether the heap contains the given value.
Parameters:
| Name | Type | Description |
|---|---|---|
val |
V | The value to check for. |
- Source:
Returns:
Whether the heap contains the value.
- Type
- boolean
decreaseKey(node, key)
Move the node up in hierarchy
Parameters:
| Name | Type | Description |
|---|---|---|
node |
Node | the node |
key |
K | new ley, must be smaller than current key |
- Source:
getCount() → {number}
The number of key-value pairs in the map
- Source:
Returns:
The number of pairs.
- Type
- number
getKeys() → (non-null) {Array.<string>}
Gets the keys of the heap.
- Source:
Returns:
The keys in the heap.
- Type
- Array.<string>
getValues() → (non-null) {Array.<*>}
Gets the values of the heap.
- Source:
Returns:
The values in the heap.
- Type
- Array.<*>
insert(key, value)
Insert the given value into the heap with the given key.
Parameters:
| Name | Type | Description |
|---|---|---|
key |
K | The key. |
value |
V | The value. |
- Source:
insertAll(heapnullable)
Adds multiple key-value pairs from another Heap or Object
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
heap |
OpenSeadragon.PriorityQueue |
<nullable> |
Object containing the data to add. |
- Source:
insertNode(node)
Insert node item.
Parameters:
| Name | Type | Description |
|---|---|---|
node |
- Source:
isEmpty() → {boolean}
Returns true if this heap contains no elements.
- Source:
Returns:
Whether this heap contains no elements.
- Type
- boolean
peek() → {V}
Retrieves but does not remove the root value of this heap.
- Source:
Returns:
The value at the root of the heap. Returns
undefined if the heap is empty.
- Type
- V
peekKey() → {string}
Retrieves but does not remove the key of the root node of this heap.
- Source:
Returns:
The key at the root of the heap. Returns undefined if the
heap is empty.
- Type
- string
remove() → {Node}
Retrieves and removes the root value of this heap.
- Source:
Returns:
The root node item removed from the root of the heap. Returns
undefined if the heap is empty.
- Type
- Node