labs.structs.Map Extends
Creates a new map.

Inheritance

Constructor

goog.labs.structs.Map()

Instance Methods

Public Protected Private
addAll(map)
Adds the content of the map to this map. If a new entry uses a key that already exists in this map, the existing key is replaced.
Arguments:
map : !goog.labs.structs.Map
The map to add.
code »
assertKeyIsString_(key)
Asserts that the given key is a string.
Arguments:
key : string
The key to check.
code »
clear()
Clears the map to the initial state.
code »
clone() !goog.labs.structs.Map
Clones this map.
Returns: !goog.labs.structs.Map  The clone of this map.
code »
containsKey(key) boolean
No description.
Arguments:
key : string
The key to check.
Returns: boolean  True if the map contains the given key.
code »
containsValue(value) boolean
Whether the map contains the given value. The comparison is done using !== comparator. Also returns true if the passed value is NaN and a NaN value exists in the map.
Arguments:
value : *
Value to check.
Returns: boolean  True if the map contains the given value.
code »
get(keyopt_default) *
Gets the value for the given key.
Arguments:
key : string
The key whose value we want to retrieve.
opt_default : *=
The default value to return if the key does not exist in the map, default to undefined.
Returns: *  The value corresponding to the given key, or opt_default if the key does not exist in this map.
code »
getCount() number
No description.
Returns: number  The number of the entries in this map.
code »
getEntries() !Array.<Array>
No description.
Returns: !Array.<Array>  An array of entries. Each entry is of the form [key, value]. Do not rely on consistent ordering of entries.
code »
getKeys() !Array.<string>
No description.
Returns: !Array.<string>  An array of all the keys contained in this map.
code »
getValues() !Array.<*>
No description.
Returns: !Array.<*>  An array of all the values contained in this map. There may be duplicates.
code »
hasKeyInPrimaryStore_(key) boolean
No description.
Arguments:
key : string
The key to check.
Returns: boolean  True if the given key has been added successfully to the primary store.
code »
isEmpty() boolean
No description.
Returns: boolean  True if the map is empty.
code »
remove(key) boolean
Removes the map entry with the given key.
Arguments:
key : string
The key to remove.
Returns: boolean  True if the entry is removed.
code »
set(keyvalue)
Adds the (key, value) pair, overriding previous entry with the same key, if any.
Arguments:
key : string
The key.
value : *
The value.
code »

Instance Properties

count_ :
No description.
Code »
map_ :
Primary backing store of this map.
Code »
secondaryStoreKeys_ :
Secondary backing store for keys. The index corresponds to the index for secondaryStoreValues_.
Code »
secondaryStoreValues_ :
Secondary backing store for keys. The index corresponds to the index for secondaryStoreValues_.
Code »

Static Methods

goog.labs.structs.Map.objectHasOwnProperty_()
No description.
code »
goog.labs.structs.Map.objectPropertyIsEnumerable_()
No description.
code »

Enumerations

goog.labs.structs.Map.BrowserFeature :
Browser feature enum necessary for map.
Constants:
OBJECT_CREATE_SUPPORTED
No description.
OBJECT_KEYS_SUPPORTED
No description.
Code »

Package labs.structs

Package Reference