Class UFMapOfSet<TKey, TValue>

UFMapOfSet can be used to store groups of unique values. It uses a Map that maps a value to a Set. The class takes care of managing the sets.

Type Parameters

  • TKey
  • TValue

Constructors

Accessors

  • get valueTotalCount(): number
  • Gets the total number of value entries.

    Returns number

Methods

  • Adds a value to the group for a key. If the value is already available in the group, nothing changes.

    Parameters

    • aKey: TKey

      Key to add for

    • aValue: TValue

      Value to add to the group of aKey

    Returns void

  • Clears the map and removes all keys and related sets.

    Returns void

  • Tries to the first key the value has been stored for.

    Parameters

    • aValue: TValue

      Value to find key

    Returns null | TKey

    the key or null if no key could be found.

  • Gets all values stored for a certain key.

    Parameters

    • aKey: TKey

      Key to get values for

    Returns TValue[]

    all values for the key or an empty array if the key does not exist.

  • Checks if the map has a certain key.

    Parameters

    • aKey: TKey

      Key to check

    Returns boolean

    true if the map contains the key.

  • Checks if the instance has a certain value for a certain key.

    Parameters

    • aKey: TKey

      Key to check

    • aValue: TValue

      Value to check

    Returns boolean

    true if the map contains the key and value.

  • Checks if the map contains any sets.

    Returns boolean

    true if there are no sets.

  • Removes a value from the group for a key.

    Parameters

    • aKey: TKey

      Key to remove for

    • aValue: TValue

      Value to remove from the group of aKey

    Returns void

  • Searches for a key that contains the value and remove it.

    Parameters

    • aValue: TValue

      Value to remove

    Returns void