Class LimitedCapacityQueue<T>

An indexed queue with limited capacity. Respects first-in-first-out insertion order.

Type Parameters

  • T

Constructors

Properties

Accessors

Methods

Constructors

Properties

count: number = 0

The number of elements in the queue.

Accessors

Methods

  • Adds an item to the back of the queue. If the queue is holding maximum elements at the point of addition, the item at the front of the queue will be removed.

    Parameters

    • item: T

      The item to be added to the back of the queue.

    Returns void

  • Retrieves the item at the given index in the queue.

    Parameters

    • index: number

      The index of the item to retrieve. The item with index 0 is at the front of the queue (it was added the earliest).

    Returns T