Class StringMap<ValueType>

A map of string keys to some ValueType.

Type Parameters

  • ValueType

Constructors

Accessors

  • get keys(): IterableIterator<string, any, any>
  • Returns IterableIterator<string, any, any>

    All the keys of the map.

  • get size(): number
  • Returns number

    The size of the map.

  • get values(): IterableIterator<ValueType, any, any>
  • Returns IterableIterator<ValueType, any, any>

    All the values of the map.

Methods

  • Retrieve the value associated with the given key.

    Parameters

    • key: string

      The key of the desired value in the map.

    Returns undefined | ValueType

  • Returns true if the map contains the given key, returns false if it does not.

    Parameters

    • key: string

    Returns boolean

  • Associate the given key with the given value in the map.

    Parameters

    • key: string

      Key to set in the map.

    • value: ValueType

      Value to be associated with the key.

    Returns void

  • Associate the given key with the given value in the map only if the key has not been set in the map.

    Parameters

    • key: string

      Key to set in the map.

    • value: ValueType

      Value to be associated with the key.

    • OptionalerrorMessage: string

      Message to log if the key already has a value.

    Returns boolean

    true if the operation is successful, false if it is not.