Class FixedPriorityQueue<T>Internal

Fixed priority queue.

Type Parameters

  • T

    Type of fixed priority queue data.

Hierarchy (view full)

Constructors

  • Constructs a fixed priority queue.

    Type Parameters

    • T

    Parameters

    • size: number = defaultQueueSize

      Fixed priority queue size.

    • enablePriority: boolean = false

      Whether to enable priority.

    Returns FixedPriorityQueue<T>

    FixedPriorityQueue.

    defaultQueueSize
    
    false
    

Properties

capacity: number

The fixed priority queue capacity.

enablePriority: boolean

Whether to enable priority.

size: number

The fixed priority queue size.

Methods

  • Dequeue data from the fixed priority queue.

    Returns undefined | T

    The dequeued data or undefined if the priority queue is empty.

  • Checks if the fixed priority queue is empty.

    Returns boolean

    true if the fixed priority queue is empty, false otherwise.

  • Enqueue data into the fixed priority queue.

    Parameters

    • data: T

      Data to enqueue.

    • Optionalpriority: number

      Priority of the data. Lower values have higher priority.

    Returns number

    The new size of the priority queue.

    If the fixed priority queue is full.

  • Checks if the fixed priority queue is full.

    Returns boolean

    true if the fixed priority queue is full, false otherwise.

  • Gets data from the fixed priority queue.

    Parameters

    • index: number

      The index of the data to get.

    Returns undefined | T

    The data at the index or undefined if the fixed priority queue is empty or the index is out of bounds.