Type Parameters

  • T

Hierarchy

  • default<T>
    • default

Constructors

  • Type Parameters

    • T

    Parameters

    • Optional initialEntries: T[]

    Returns default<T>

Properties

_array: T[]
_head: number = 0
_size: number = 0
_tail: number = 0

Accessors

  • get count(): number
  • The number of items currently in the queue.

    Returns

    Returns number

  • get isEmpty(): boolean
  • Returns true if the queue is empty.

    Returns

    Returns boolean

Methods

  • Returns undefined | T

  • Parameters

    • item: T

    Returns void

  • Returns Iterator<T, any, undefined>

  • Returns undefined | T

  • Returns number

  • Produces an iterable that dequeues items when iterated. Stops when empty.

    Returns

    Returns Iterable<T>

  • Pulls an entry from the head of the queue and returns it. Returns undefined if the queue is already empty.

    Returns undefined | T

  • Pulls an entry from the head of the queue and returns it. Returns undefined if the queue is already empty and throwIfEmpty is false.

    Throws

    If the queue is already empty and throwIfEmpty is true.

    Parameters

    • throwIfEmpty: true

    Returns T

  • Pulls an entry from the head of the queue and returns it. Returns undefined if the queue is already empty and throwIfEmpty is false.

    Throws

    If the queue is already empty and throwIfEmpty is true.

    Parameters

    • throwIfEmpty: boolean

    Returns undefined | T

  • Clears the list.

    Returns void

  • Dequeues entries into an array.

    Parameters

    • max: number = Infinity

    Returns T[]

  • Adds an item to the end of the queue.

    Returns

    Parameters

    • value: T

    Returns default<T>

  • Adds items to the end of the queue.

    Returns

    Parameters

    • values: Iterable<T>

    Returns default<T>

  • Adds items to the end of the queue.

    Returns

    Parameters

    • Rest ...values: T[]

    Returns default<T>

  • Returns number

  • Returns the entry at the head of the queue. Returns undefined if the queue is already empty.

    Returns undefined | T

  • Returns the entry at the head of the queue. Returns undefined if the queue is already empty and throwIfEmpty is false.

    Throws

    If the queue is already empty and throwIfEmpty is true.

    Parameters

    • throwIfEmpty: true

    Returns T

  • Returns the entry at the head of the queue. Returns undefined if the queue is already empty and throwIfEmpty is false.

    Throws

    If the queue is already empty and throwIfEmpty is true.

    Parameters

    • throwIfEmpty: boolean

    Returns undefined | T

  • Clears the list.

    Returns void

  • Trims excess items in the underlying array.

    Parameters

    • Optional threshold: number

    Returns void

  • Checks to see if the queue has entries an pulls an entry from the head of the queue and passes it to the out handler.

    Returns

    True if a value was retrieved. False if not.

    Parameters

    • out: ((value: T) => void)

      The 'out' handler that receives the value if it exists.

        • (value: T): void
        • Parameters

          • value: T

          Returns void

    Returns boolean

Generated using TypeDoc