Class MultiMap<K, V>

Container that associates a key with multiple distinct values.

Type Parameters

  • K
  • V

Hierarchy (view full)

Constructors

Accessors

  • get dimension(): number
  • Number of distinct keys.

    Returns number

Methods

  • Add a key-value pair. Values are stored in a Set, so duplicates are skipped.

    Parameters

    • key: K
    • value: V

    Returns number

    count(key) after the operation.

  • Remove a key-value pair. No-op if key-value does not exist.

    Parameters

    • key: K
    • value: V

    Returns number

    count(key) after the operation.