Class for Hash Map datastructure.
| Instance Method Summary | |
__iterator__(boolean= opt_keys) ⇒ !goog.iter.IteratorReturns an iterator that iterates over the values or the keys in the map. This throws an exception if the map was mutated since the iterator was created. | |
addAll(?Object map)Adds multiple key-value pairs from another goog.structs.Map or Object. | |
cleanupKeysArray_()Cleans up the temp keys array by removing entries that are no longer in the map. | |
clear()Removes all key-value pairs from the map. | |
clone() ⇒ !goog.structs.MapClones a map and returns a new map. | |
containsKey(<Any Type> key) ⇒ booleanWhether the map contains the given key. | |
containsValue(<Any Type> val) ⇒ booleanWhether the map contains the given value. This is O(n). | |
equals(?goog.structs.Map otherMap, function (*, *): boolean= opt_equalityFn) ⇒ booleanWhether this map is equal to the argument map. | |
get(<Any Type> key, <Any Type> opt_val) ⇒ <Any Type>Returns the value for the given key. If the key is not found and the default value is not given this will return {@code undefined}. | |
getCount() ⇒ number | |
getKeyIterator() ⇒ !goog.iter.IteratorReturns an iterator that iterates over the keys in the map. Removal of keys while iterating might have undesired side effects. | |
getKeys() ⇒ !ArrayReturns the keys of the map. | |
getValueIterator() ⇒ !goog.iter.IteratorReturns an iterator that iterates over the values in the map. Removal of keys while iterating might have undesired side effects. | |
getValues() ⇒ !ArrayReturns the values of the map. | |
isEmpty() ⇒ boolean | |
remove(<Any Type> key) ⇒ booleanRemoves a key-value pair based on the key. This is O(logN) amortized due to updating the keys array whenever the count becomes half the size of the keys in the keys array. | |
set(<Any Type> key, <Any Type> value)Adds a key-value pair to the map. | |
toObject() ⇒ !Object | |
transpose() ⇒ !goog.structs.MapReturns a new map in which all the keys and values are interchanged (keys become values and values become keys). If multiple keys map to the same value, the chosen transposed value is implementation-dependent. It acts very similarly to {goog.object.transpose(Object)}. | |
| Static Method Summary | |
defaultEquals(<Any Type> a, <Any Type> b) ⇒ booleanDefault equality test for values. | |
hasKey_(?Object obj, <Any Type> key) ⇒ booleanSafe way to test for hasOwnProperty. It even allows testing for 'hasOwnProperty'. | |