@tsdotnet/collection-base - v2.1.1
    Preparing search index...

    Class CollectionBase<T>Abstract

    Base class for implementing an externally modifiable collection.

    Type Parameters

    • T

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    Properties

    _equalityComparer: EqualityComparison<T> = areEqual

    Accessors

    • get version(): number

      The version number used to track changes.

      Returns number

    Methods

    • Parameters

      • entries: undefined | null | Iterable<T, any, any>

      Returns number

    • Parameters

      • entry: T
      • Optionalmax: number

      Returns number

    • Clears the collection. Provided for compatibility with disposal routines.

      Returns void

    • Applies a reducer function to all the elements in this sequence. The first entry is used as the initial accumulator value, and the specified function is used to select the result value.

      Type Parameters

      • T

      Parameters

      • reduction: (previous: T, current: T, index: number) => T

      Returns T

      If the sequence is empty.

    • Applies a reducer function to all the elements in this sequence. The specified seed value is used as the initial accumulator value, and the specified function is used to select the result value.

      Type Parameters

      • T
      • U

      Parameters

      • reduction: (previous: U, current: T, index: number) => U
      • initialValue: U

      Returns U

    • Removes entries from the collection allowing for a limit. For example if the collection not a distinct set, more than one entry could be removed.

      Parameters

      • entry: T

        The entry to remove.

      • max: number = Infinity

        Limit of entries to remove. Will remove all matches if no max specified.

      Returns number

      The number of entries removed.