Class Queue<T>

A generic Queue class.

Type Parameters

  • T

    The type of elements in the queue.

Hierarchy

  • Queue

Constructors

Properties

Accessors

Methods

Constructors

  • Type Parameters

    • T

    Returns Queue<T>

Properties

queue: T[] = []

The array to hold the queue's elements.

Accessors

Methods

  • Creates an iterator for the queue.

    Returns Iterator<T, any, undefined>

    Yields

    The next element in the queue.

  • Creates a new Queue instance from an iterable.

    Type Parameters

    • T

      The type of elements in the iterable.

    Parameters

    • o: Iterable<T>

      The iterable to create the queue from.

    Returns Queue<T>

    A new Queue instance.

  • Creates a new Queue instance from a JSON string.

    Type Parameters

    • T

      The type of elements in the JSON string.

    Parameters

    • json: string

      The JSON string to create the queue from.

    Returns Queue<T>

    A new Queue instance.

Generated using TypeDoc