Options
All
  • Public
  • Public/Protected
  • All
Menu

Type parameters

  • T

  • K = T

Hierarchy

  • HashIndexOptions

Index

Properties

Optional capacity

capacity: number

The initial capacity of the underling vector that will store the hash buckets.

Optional elements

elements: Iterable<T>

An iterable that will be consumed to fill the index.

Optional elementsEqual

elementsEqual: (a: T, b: T) => boolean

A predicate determining when two elements are equal.

This function is only called after is has been determined that the keys are equal, so you may safely skip the equality check for the keys.

If omitted, the built-in equality function will be used.

Type declaration

    • (a: T, b: T): boolean
    • Parameters

      • a: T
      • b: T

      Returns boolean

Optional getHash

getHash: (element: K) => number

The hashing function that will be used to map entries to a certain bucket.

If omitted, the built-in hash function will be used.

Type declaration

    • (element: K): number
    • Parameters

      • element: K

      Returns number

Optional getKey

getKey: (value: T) => K

A function that should extract the key out of an element.

For example, dictionaries simply take the first element of a tuple array to be the key.

Type declaration

    • (value: T): K
    • Parameters

      • value: T

      Returns K

Optional keysEqual

keysEqual: (a: K, b: K) => boolean

A predicate for determining when two keys are equal.

Two keys may produce the same hash result, but that does not necessarily mean that they are equal. This function resolves any conflicts.

If omitted, the built-in equality function will be used.

Type declaration

    • (a: K, b: K): boolean
    • Parameters

      • a: K
      • b: K

      Returns boolean

Optional onDuplicateElements

onDuplicateElements: ResolveAction

What to do when the the element being added already exists in the index.

This property defaults to [[ResolveAction.Error]].

Optional onDuplicateKeys

onDuplicateKeys: ResolveAction

What to do when the key of the element being added already exists in the index.

This property defaults to [[ResolveAction.Error]].

Legend

  • Property
  • Method
  • Accessor
  • Property
  • Method
  • Inherited property
  • Inherited method

Generated using TypeDoc