Class LimitedList<T>

Limited List. This list at max contains a specific amount of elements. After the max number of elements has been added, the first element added will be removed.

Type Parameters

  • T

Hierarchy

  • LimitedList

Constructors

Properties

Accessors

Methods

Constructors

Properties

maxLength: number

Accessors

  • get currentPointer(): number
  • Gets the current pointer.

    Memberof

    LimitedList

    Returns number

  • get length(): number
  • Contains the Length of the list.

    Memberof

    LimitedList

    Returns number

Methods

  • Returns the current item, the pointer is showing at.

    Returns

    Returns T

  • Helper to iterate over all items.

    Parameters

    • callbackFn: ((item, index, array) => void)
        • (item, index, array): void
        • Parameters

          • item: T
          • index: number
          • array: T[]

          Returns void

    • Optional thisArg: any

    Returns void

  • Pops the last element. If there is no element undefined is returned.

    Returns

    The last element.

    Parameters

    • current: boolean = false

    Returns T

  • Returns the last item. Adapts the pointer and the current item is the last item. example: l = limited.last() c = limited.current()

     l == c -> True
    

    Returns

    The last element.

    Returns T

  • Adds Data to the Stack. The Pointer is getting adapted.

    Returns

    Memberof

    LimitedList

    Parameters

    • data: T

    Returns number

Generated using TypeDoc