This is a sorted order data structure for constant/bulk insert data that performs near the speed of a hash table that maps 32 bit unsigned integers to 32bit unsigned integers.

Implements

  • ReadonlyMap<number, number>

Constructors

Accessors

Methods

Constructors

  • Construct the interpolation search table

    Parameters

    • keyValues_: Uint32Array

      This is expected to be an array with pairs of elements as a key-value pair packed into the array with keys. e.g. [0] = value, [1] = key and so on.

      This will be mutated in-place, so copy if you do not wish the array to be mutated.

    • alreadySorted: boolean = false

    Returns default

Accessors

Methods

  • Iterates through all the entries in this.

    Returns IterableIterator<[number, number]>

    Iterate through all entries.

  • Iterate through all entries (key value pairs)

    Returns IterableIterator<[number, number]>

    A key value pair.

  • Implements Map Foreach.

    Parameters

    • callbackfn: (value: number, key: number, map: ReadonlyMap<number, number>) => void

      The for each callback.

    • OptionalthisArg: any

      Overridable this arg.

    Returns void

  • Will find an exact key (first match) and return its value, or undefined if not found.

    Parameters

    • key: number

      The key to search for.

    Returns undefined | number

    The matching value, or undefined if no matching value is found.

  • Does this have the matching key?

    Parameters

    • key: number

      The key to search for

    Returns boolean

    True if found, false otherwise.