Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TwoKeyMap<K, V>

A Map with two keys as opposed to one. Order does matter, so map.get(k1, k2) !== map.get(k2, k1) for example.

Type parameters

  • K

  • V

Hierarchy

  • TwoKeyMap

Index

Properties

Methods

Properties

Private values

values: Map<K, Map<K, V>> = new Map()

Internal storage for the TwoKeyMap, which is just a Map of Maps.

Methods

clear

  • clear(): void

forEach

  • forEach(handler: function): void
  • Similar to JavaScript's Map.prototype.forEach, but with slightly different arguments.

    Parameters

    • handler: function
        • (k1: K, k2: K, val: V): void
        • Parameters

          • k1: K
          • k2: K
          • val: V

          Returns void

    Returns void

get

  • get(k1: K, k2: K): V
  • Gets the value associated with [k1, k2].

    Parameters

    • k1: K
    • k2: K

    Returns V

set

  • set(k1: K, k2: K, val: V): void
  • Creates a relationship between [k1, k2] and v, overwriting if one already exists.

    Parameters

    • k1: K
    • k2: K
    • val: V

    Returns void

Generated using TypeDoc