UNPKG

@empathyco/x-components

Version:
43 lines (29 loc) 2.79 kB
<!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [@empathyco/x-components](./x-components.md) &gt; [BaseXPriorityQueue](./x-components.basexpriorityqueue.md) ## BaseXPriorityQueue class . Default [XPriorityQueue](./x-components.xpriorityqueue.md) implementation. Method big-O \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- - push O(n) - pop O(1) - peek O(1) - at O(1) **Signature:** ```typescript export declare class BaseXPriorityQueue<SomeRecord extends Dictionary, SomeData extends Dictionary = Dictionary> implements XPriorityQueue<SomeRecord, SomeData> ``` **Implements:** [XPriorityQueue](./x-components.xpriorityqueue.md)<!-- -->&lt;SomeRecord, SomeData&gt; ## Constructors | Constructor | Modifiers | Description | | --- | --- | --- | | [(constructor)(comparatorFn)](./x-components.basexpriorityqueue._constructor_.md) | | Creates a new [XPriorityQueue](./x-components.xpriorityqueue.md)<!-- -->. | ## Properties | Property | Modifiers | Type | Description | | --- | --- | --- | --- | | [keys](./x-components.basexpriorityqueue.keys.md) | <code>readonly</code> | (keyof SomeRecord)\[\] | The <code>keys</code> property of a [XPriorityQueue](./x-components.xpriorityqueue.md) represents the keys of that queue. The value is an array of the parametrized <code>Key</code> type. | ## Methods | Method | Modifiers | Description | | --- | --- | --- | | [at(index)](./x-components.basexpriorityqueue.at.md) | | Retrieves the [node](./x-components.xpriorityqueuenode.md) at a given position. | | [clear()](./x-components.basexpriorityqueue.clear.md) | | Removes all the [nodes](./x-components.xpriorityqueuenode.md) from the queue. | | [isEmpty()](./x-components.basexpriorityqueue.isempty.md) | | Checks if the queue is empty. | | [peek()](./x-components.basexpriorityqueue.peek.md) | | Retrieves, but does not remove, the head [node](./x-components.xpriorityqueuenode.md) of the queue. | | [pop()](./x-components.basexpriorityqueue.pop.md) | | See [XPriorityQueue.pop](./x-components.xpriorityqueue.pop.md)<!-- -->. | | [push(key, priority, data)](./x-components.basexpriorityqueue.push.md) | | . See [XPriorityQueue.push](./x-components.xpriorityqueue.push.md)<!-- -->. | | [size()](./x-components.basexpriorityqueue.size.md) | | Retrieves the number of [nodes](./x-components.xpriorityqueuenode.md) stored in the queue. | | [toString()](./x-components.basexpriorityqueue.tostring.md) | | Returns a string representation of this collection. The string representation consists of a list of the queue [nodes](./x-components.xpriorityqueuenode.md) split in multiple lines, one for each one. Nodes are converted to strings as by toString(). |