Class SequentialContainer<T>Abstract

Type Parameters

  • T

Hierarchy

Constructors

Methods

  • Description

    Iterate over all elements in the container.

    Parameters

    • callback: ((element: T, index: number) => void)

      Callback function like Array.forEach.

        • (element: T, index: number): void
        • Parameters

          • element: T
          • index: number

          Returns void

    Returns void

  • Description

    Insert several elements after the specified position.

    Parameters

    • pos: number

      The position you want to insert.

    • element: T

      The element you want to insert.

    • Optional num: number

      The number of elements you want to insert (default 1).

    Returns void

  • Description

    Sets element by position.

    Parameters

    • pos: number

      The position you want to change.

    • element: T

      The element's value you want to update.

    Returns void

  • Description

    Sort the container.

    Parameters

    • Optional cmp: ((x: T, y: T) => number)

      Comparison function.

        • (x: T, y: T): number
        • Parameters

          • x: T
          • y: T

          Returns number

    Returns void

Generated using TypeDoc