Class: shaka.util.MultiMap

Constructor

new MultiMap()

A simple multimap template.
Source:

Members

(private, non-null) map_ :Object.<string, !Array.<T>>

Type:
  • Object.<string, !Array.<T>>
Source:

Methods

clear()

Clear all keys and values from the multimap.
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() → (non-null) {Array.<T>}

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

has(key) → {boolean}

Check for a key.
Parameters:
Name Type Description
key string
Source:
Returns:
true if the key exists.
Type
boolean

keys() → (non-null) {Array.<string>}

Get all keys from the multimap.
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:

set(key, valuesnon-null)

Set an array of values for the key, overwriting any previous data.
Parameters:
Name Type Description
key string
values Array.<T>
Source: