class · System

PriorityQueue<E, P>

public class System.PriorityQueue<E, P> : System.Any

Elements with priorities; Dequeue gives one with the smallest priority (among equals, in no set order).

Kind
class
Namespace
System
Assembly
System.Core
Access
public
Source file
PriorityQueue.ant

Type parameters

NameConstraints
Eany type
PSystem.IComparable<P>

Inheritance

Base classes
Any PriorityQueue<E, P>

Constructors

constructor PriorityQueue()
#
constructor PriorityQueue(capacity: i32)
#

Properties

property Count: i32
#

read-only

property IsEmpty: bool
#

read-only

property PeekPriority: P
#

read-only

Methods

method Enqueue(element: E, priority: P) -> void
#
method Dequeue() -> E
#

The element with the smallest priority, taken out.

method Peek() -> E
#

The element with the smallest priority, and that priority (left in).

method EnqueueDequeue(element: E, priority: P) -> E
#

Enqueue then Dequeue, in one step (the new element comes straight back when it is the smallest).

method Clear() -> void
#

Private and internal members (7)

field elements: E[]
#

private

field priorities: P[]
#

private

field count: i32
#

private

method Grow() -> void
#

private

static method Empty() -> void
#

private static

method Up(at: i32, element: E, priority: P) -> void
#

private

Moves the entry at at (element, priority) up past larger parents.

method Down(at: i32, element: E, priority: P) -> void
#

private

Puts (element, priority) at at and moves it down past smaller children.

Inherited members (5)

Source

PriorityQueue<E, P> as Larva HIR, decompiled from its Larva HIR.

System.PriorityQueue.hir
// Elements with priorities; Dequeue gives one with the smallest priority (among equals, in no set order).
public class System.PriorityQueue<E, P> : System.Any
{
    field elements: E[]
    field priorities: P[]
    field count: i32
    method Grow() -> void
    static method Empty() -> void
    // Moves the entry at `at` (element, priority) up past larger parents.
    method Up(at: i32, element: E, priority: P) -> void
    // Puts (element, priority) at `at` and moves it down past smaller children.
    method Down(at: i32, element: E, priority: P) -> void
    constructor PriorityQueue()
    constructor PriorityQueue(capacity: i32)
    method Enqueue(element: E, priority: P) -> void
    // The element with the smallest priority, taken out.
    method Dequeue() -> E
    // The element with the smallest priority, and that priority (left in).
    method Peek() -> E
    // Enqueue then Dequeue, in one step (the new element comes straight back when it is the smallest).
    method EnqueueDequeue(element: E, priority: P) -> E
    method Clear() -> void
    property Count: i32
    property IsEmpty: bool
    property PeekPriority: P
}
Esc