An abstract collection that implements many generic methods, reusable by most maps.
Returns whether an entry with the given key exists in a Map
.
Gets the value for a key in a map.
Sets the value for a given key.
Adds a value for a given key to a map.
Deletes the value for a given key. Returns whether the key was found and successfully deleted.
Returns an array of the keys of this map.
Returns an array of the values of this map.
Returns an array of all [key, value] entries for this map.
Copies values or entries from another collection into this collection, and then returns this.
Deletes all of the values in the collection.
Aggregates every value in this collection with the result collected up to that index.
Aggregates every value in this collection, from right to left.
Used by JSON.stringify
to create a JSON representation of the collection.
Returns whether this collection is equivalent to the given collection.
Adds a listener for when the value for a key changes, or when entries are added or removed.
Adds a listener for before map entries are created, deleted, or updated.
Unregisters a map change listener provided by addMapChangeListener.
Unregisters a map change listener provided by addBeforeMapChangeListener or addMapChangeListener with the beforeChange
flag.
Informs map change listeners that an entry was created, deleted, or updated.
Informs map change listeners that an entry will be created, deleted, or updated.
require("collections/shim-object");
var GenericMap = require("collections/generic-map");
Object.addEach(MyMap.prototype, GenericMap.prototype);