Interface IFixedQueue<T>Internal

Fixed queue.

interface IFixedQueue<T> {
    [iterator]: (() => Iterator<T, any, any>);
    capacity: number;
    clear: (() => void);
    dequeue: (() => undefined | T);
    empty: (() => boolean);
    enqueue: ((data: T, priority?: number) => number);
    full: (() => boolean);
    get: ((index: number) => undefined | T);
    nodeArray: FixedQueueNode<T>[];
    size: number;
}

Type Parameters

  • T

    Type of fixed queue data.

Properties

[iterator]: (() => Iterator<T, any, any>)

Returns an iterator for the fixed queue.

Type declaration

    • (): Iterator<T, any, any>
    • Returns Iterator<T, any, any>

      An iterator for the fixed queue.

capacity: number

The fixed queue capacity.

clear: (() => void)

Clears the fixed queue.

dequeue: (() => undefined | T)

Dequeue data from the fixed queue.

Type declaration

    • (): undefined | T
    • Returns undefined | T

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

empty: (() => boolean)

Checks if the fixed queue is empty.

Type declaration

    • (): boolean
    • Returns boolean

      true if the fixed queue is empty, false otherwise.

enqueue: ((data: T, priority?: number) => number)

Enqueue data into the fixed queue.

Type declaration

    • (data, priority?): number
    • Parameters

      • data: T

        Data to enqueue.

      • Optionalpriority: number

        Priority of the data. Lower values have higher priority.

      Returns number

      The new size of the fixed queue.

If the fixed queue is full.

full: (() => boolean)

Checks if the fixed queue is full.

Type declaration

    • (): boolean
    • Returns boolean

      true if the fixed queue is full, false otherwise.

get: ((index: number) => undefined | T)

Gets data from the fixed queue.

Type declaration

    • (index): undefined | T
    • Parameters

      • index: number

        The index of the data to get.

      Returns undefined | T

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

nodeArray: FixedQueueNode<T>[]

The fixed queue node array.

size: number

The fixed queue size.