Class Mapping<K, V>Abstract

A mapping is a Collection indexed by keys that may have associated values.

Abstract

Template

V

Type Parameters

  • K

  • V

Hierarchy

Constructors

Accessors

Methods

Constructors

Accessors

  • get size(): number
  • Returns the total number of elements in the collection.

    Returns number

Methods

  • Adds a new item to the collection.

    Parameters

    • item: any

      The item to add to the collection.

    Returns any

  • Checks if item is present in the collection.

    Returns

    true when the element is found, else false

    Parameters

    • item: any

      The item to search for in the collection.

    Returns boolean

  • Returns an iterator of all the [key, value] pairs in the map.

    Returns Iterable<[K, V]>

  • Returns the value for the given key, or return defaults if not found.

    Parameters

    • key: K
    • Optional defaults: any

    Returns V

  • Sets the value for the given key.

    Parameters

    • key: K
    • value: V

    Returns any

  • Returns an iterator of all the values in the map.

    Returns Iterable<V>

Generated using TypeDoc