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

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?: any
_max: any
_min: any
_sum: any

Accessors

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

    Returns number

  • get back(): Type
  • The back element

    Returns Type

  • 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 front(): Type
  • The front element

    Returns Type

  • 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>

  • Clear all the numbers, collection becomes empty

    Returns Numbers

    this

  • Pop the front number from the collection

    Returns undefined | number

    the front number removed

  • Push a value to the back to the collection

    Parameters

    • value: number

      number to add

    Returns Numbers

    this

Generated using TypeDoc