Class HashMap<TKey, TVal>

A Map implementation that maps the Key object to a string using the provided hash function. This ensures that equal objects that are not the same instance are mapped to the same value.

Type Parameters

  • TKey = any

  • TVal = any

Hierarchy

Implements

  • Map<TKey, TVal>

Constructors

  • Type Parameters

    • TKey = any

    • TVal = any

    Parameters

    • hashFn: ((key: TKey) => string)
        • (key: TKey): string
        • Parameters

          • key: TKey

          Returns string

    • Optional iterable: Iterable<readonly [TKey, TVal]>

    Returns HashMap<TKey, TVal>

Properties

[toStringTag]: "HashMap" = 'HashMap'
hashFn: ((key: TKey) => string)

Type declaration

    • (key: TKey): string
    • Parameters

      • key: TKey

      Returns string

hashMap: Map<string, Entry<TKey, TVal>>

Accessors

Methods

  • Returns IterableIterator<[TKey, TVal]>

  • Parameters

    • key: TKey

    Returns boolean

  • Returns IterableIterator<[TKey, TVal]>

  • Parameters

    • callbackfn: ((value: TVal, key: TKey, map: Map<TKey, TVal>) => void)
        • (value: TVal, key: TKey, map: Map<TKey, TVal>): void
        • Parameters

          • value: TVal
          • key: TKey
          • map: Map<TKey, TVal>

          Returns void

    • Optional thisArg: any

    Returns void

  • Parameters

    • key: TKey

    Returns undefined | TVal

  • Returns IterableIterator<TVal>