Class WrappedSetMultiMap<TKey, TVal>

A SetMultiMap that uses an internal Map based on the provided constructor.

In case no input constructor is provided, the default Map implementation will be used.

It is required that the value type of this map is not Set or any extension of Set, otherwise the set and add functions wil break.

Type Parameters

  • TKey

  • TVal

Hierarchy

Implements

Constructors

  • Type Parameters

    • TKey

    • TVal

    Parameters

    • mapConstructor: (new () => Map<any, any>) = Map

      Will be used to instantiate the internal Map.

        • new (): Map<any, any>
        • Returns Map<any, any>

    • Optional iterable: Iterable<readonly [TKey, TVal | ReadonlySet<TVal>]>

      Entries to add to the map.

    Returns WrappedSetMultiMap<TKey, TVal>

Properties

[toStringTag]: "WrappedSetMultiMap" = 'WrappedSetMultiMap'
count: number
map: Map<TKey, Set<TVal>>

Accessors

Methods

  • Loops over all key/value bindings.

    Parameters

    • callbackfn: ((value, key, map) => void)
        • (value, key, map): void
        • Parameters

          Returns void

    • Optional thisArg: any

    Returns void

  • Returns all values stored for the given key. Returns undefined if there are no values for this key.

    Parameters

    • key: TKey

    Returns undefined | ReadonlySet<TVal>