A collection of number Queue with the following efficient mathematic computation:

  • minimum value in the collection
  • maximum value in the collection
  • average value of the collection

Hierarchy (view full)

Constructors

  • Instantiate the collection of the number

    Parameters

    • Optional capacity: number

      if set it limits the number of values stored, any exceding number pops the first number pushed (FIFO)

    Returns Numbers

Properties

_average?: number
_max: number = 0
_min: number = 0
_sum: number = 0

Accessors

  • get average(): number
  • average value of the collection, or 0 if collection if empty

    Returns number

  • get capacity(): undefined | number
  • Maximum capacity for the queue, if not set queue has unlimited capacity

    Returns undefined | number

  • set capacity(value): void
  • Set a maximum capacity for the queue, if you push new value exceding this capacity the firsts are removed (FIFO) if set to undefined the queue is unlimited

    Parameters

    • value: undefined | number

    Returns void

  • get maximum(): number
  • maximum value in the collection, or 0 if colleciton is empty

    Returns number

  • get minimum(): number
  • minimum value in the collection, or 0 if colleciton is empty

    Returns number

  • get size(): number
  • Number of element in the queue

    Returns number

Methods

  • Iterator though queue's elements

    Returns IterableIterator<number>

  • Pop the front number from the collection

    Returns undefined | number

    the front number removed

Generated using TypeDoc