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

  • Iterates over all key/value bindings in this Map.

    Returns IterableIterator<[TKey, TVal]>

  • Returns a Readonly Map representation of this Map.

    Returns ReadonlyMap<TKey, ReadonlySet<TVal>>

  • Deletes the given key/value binding from the Map.

    Parameters

    • key: TKey
    • value: TVal

    Returns boolean

  • Iterates over all distinct keys in this Map.

    Returns IterableIterator<TKey>

  • Iterates over all key/value bindings in this Map.

    Returns IterableIterator<[TKey, TVal]>

  • Iterates over all distinct keys in this Map, together with a Set of their values.

    Returns IterableIterator<[TKey, ReadonlySet<TVal>]>

  • Loops over all key/value bindings.

    Parameters

    • callbackfn: ((value: TVal, key: TKey, map: SetMultiMap<TKey, TVal>) => void)
        • (value: TVal, key: TKey, map: SetMultiMap<TKey, TVal>): 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>

  • Returns true if this key/value binding exists in the Map.

    Parameters

    • key: TKey
    • value: TVal

    Returns boolean

  • Iterates over all distinct keys and returns their Set of values.

    Returns IterableIterator<ReadonlySet<TVal>>