Support methods for Map

Methods

Methods

  • Gets a value from a map for a certain key. If no value exists, create a new value, store it in the map and return it.

    Type Parameters

    • TKey
    • TValue

    Parameters

    • aMap: Map<TKey, TValue>

      Map to get value from and update if necessary

    • aKey: TKey

      Key to get value for

    • aFactory: (() => TValue)

      Factory function that will be called to create a new value if none could be found

    Returns TValue

    the value in the map