Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Map<K, V>

Type parameters

  • K: string | number

  • V

Hierarchy

Index

Constructors

constructor

Properties

Private _items

_items: MapItems<Entry<K, V>>

Private _length

_length: number = 0

Accessors

length

  • get length(): number
  • Returns the number of key-value mappings in this map.

    Returns number

    map

Methods

Private add

  • add(key: K, entry: Entry<K, V>): V

clear

  • clear(): void

containsKey

  • containsKey(key: K): boolean

containsValue

  • containsValue(value: V): boolean

entrySet

  • entrySet(): Array<Entry<K, V>>

filter

  • filter<U>(predicate: function): Map<K, V>
  • Type parameters

    • U

    Parameters

    • predicate: function
        • (entry: Entry<K, V>): boolean
        • Parameters

          Returns boolean

    Returns Map<K, V>

forEach

  • forEach<T>(callback: function): boolean
  • Type parameters

    • T

    Parameters

    • callback: function
        • (item: V, key?: K): void | boolean
        • Parameters

          • item: V
          • Optional key: K

          Returns void | boolean

    Returns boolean

get

  • get(key: K): V

getOrDefault

  • getOrDefault(key: K, def: V): V

isEmpty

  • isEmpty(): boolean
  • Returns true if this map contains no key-value mappings.

    Returns boolean

iterator

keySet

  • keySet(): Array<K>

map

  • map<U>(callback: function): Array<U>
  • Type parameters

    • U

    Parameters

    • callback: function
        • (value: V, key: K): U
        • Parameters

          • value: V
          • key: K

          Returns U

    Returns Array<U>

put

  • put(key: K, value: V): V

putAll

  • putAll(map: Map<K, V> | MapItems<V> | Array<V>): Array<V>

remove

  • remove(key: K): boolean

values

  • values(): Array<V>

Generated using TypeDoc