Class CoordinateMap<V>

data-structure-typed

Author

Tyler Zeng

Copyright

Copyright (c) 2022 Tyler Zeng zrwusa@gmail.com

License

MIT License

Type Parameters

  • V

Hierarchy

  • Map<any, V>
    • CoordinateMap

Constructors

Properties

[toStringTag]: string
_joint: string = '_'
size: number

Returns

the number of elements in the Map.

[species]: MapConstructor

Accessors

Methods

  • Returns an iterable of entries in the map.

    Returns IterableIterator<[any, V]>

  • Returns void

  • The function overrides the delete method and joins the key array using a specified joint character before calling the super delete method.

    Parameters

    • key: number[]

      An array of numbers that represents the key to be deleted.

    Returns boolean

    The delete method is returning the result of calling the delete method on the superclass, with the key array joined together using the _joint property.

  • Returns an iterable of key, value pairs for every entry in the map.

    Returns IterableIterator<[any, V]>

  • Executes a provided function once per each key/value pair in the Map, in insertion order.

    Parameters

    • callbackfn: ((value, key, map) => void)
        • (value, key, map): void
        • Parameters

          • value: V
          • key: any
          • map: Map<any, V>

          Returns void

    • Optional thisArg: any

    Returns void

  • The function overrides the get method to join the key array with a specified joint and then calls the super get method.

    Parameters

    • key: number[]

      An array of numbers

    Returns undefined | V

    The code is returning the value associated with the specified key in the map.

  • The "has" function overrides the base class's "has" function and checks if a key exists in the map by joining the key array with a specified delimiter.

    Parameters

    • key: number[]

      The parameter "key" is an array of numbers.

    Returns boolean

    The has method is being overridden to return the result of calling the has method of the superclass (super.has) with the key array joined together using the _joint property.

  • Returns an iterable of keys in the map

    Returns IterableIterator<any>

  • The function overrides the set method of a Map object to convert the key from an array to a string using a specified delimiter before calling the original set method.

    Parameters

    • key: number[]

      The key parameter is an array of numbers.

    • value: V

      The value parameter is the value that you want to associate with the specified key.

    Returns CoordinateMap<V>

    The set method is returning the result of calling the set method of the superclass (super.set(key.join(this._joint), value)).

  • Returns an iterable of values in the map

    Returns IterableIterator<V>

Generated using TypeDoc