@ceeblue/web-utils
    Preparing search index...

    Class Numbers

    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 Summary)

    Index

    Constructors

    • Instantiate the collection of the number

      Parameters

      • Optionalcapacity: number

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

      Returns Numbers

    Accessors

    • get average(): number

      average value of the collection, or 0 if collection if empty

      Returns number

    • get capacity(): number | undefined

      Maximum capacity for the queue, if not set queue has unlimited capacity

      Returns number | undefined

    • set capacity(value: number | undefined): 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: number | undefined

      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 number | undefined

      the front number removed