Class: shaka.util.MultiMap

A simple multimap template.

Constructor

new MultiMap()

A simple multimap template.

Source:

Members

map_ :Map<string, !Array<T>>

Type:
  • Map<string, !Array<T>>
Source:

Methods

clear()

Clear all keys and values from the multimap.
Source:

forEach(callback)

Parameters:
Name Type Description
callback function(string, !Array<T>)
Source:

get(key) → {Array<T>}

Get a list of values by key.
Parameters:
Name Type Description
key string
Source:
Returns:
or null if no such key exists.
Type
Array<T>

getAll() → {Array<T>}

Get a list of all values.
Source:
Returns:
Type
Array<T>

keys() → {Array<string>}

Get a list of all the keys.
Source:
Returns:
Type
Array<string>

push(key, value)

Add a key, value pair to the map.
Parameters:
Name Type Description
key string
value T
Source:

remove(key, value)

Remove a specific value, if it exists.
Parameters:
Name Type Description
key string
value T
Source:

size() → {number}

Returns the number of elements in the multimap.
Source:
Returns:
Type
number