mxDictionary

A wrapper class for an associative array with object keys.  Note: This implementation uses <mxObjectIdentitiy> to turn object keys into strings.

Summary
mxDictionaryA wrapper class for an associative array with object keys.
Functions
mxEventSourceConstructs a new dictionary which allows object to be used as keys.
mapStores the (key, value) pairs in this dictionary.
clearClears the dictionary.
getReturns the value for the given key.
putStores the value under the given key and returns the previous value for that key.
removeRemoves the value for the given key and returns the value that has been removed.
getKeysReturns all keys as an array.
getValuesReturns all values as an array.
visitVisits all entries in the dictionary using the given function with the following signature: function(key, value) where key is a string and value is an object.

Functions

mxEventSource

Constructs a new dictionary which allows object to be used as keys.

map

Stores the (key, value) pairs in this dictionary.

clear

mxDictionary.prototype.clear = function()

Clears the dictionary.

get

mxDictionary.prototype.get = function(key)

Returns the value for the given key.

put

mxDictionary.prototype.put = function(key,
value)

Stores the value under the given key and returns the previous value for that key.

remove

mxDictionary.prototype.remove = function(key)

Removes the value for the given key and returns the value that has been removed.

getKeys

mxDictionary.prototype.getKeys = function()

Returns all keys as an array.

getValues

mxDictionary.prototype.getValues = function()

Returns all values as an array.

visit

mxDictionary.prototype.visit = function(visitor)

Visits all entries in the dictionary using the given function with the following signature: function(key, value) where key is a string and value is an object.

Parameters

visitorA function that takes the key and value as arguments.
mxDictionary.prototype.clear = function()
Clears the dictionary.
mxDictionary.prototype.get = function(key)
Returns the value for the given key.
mxDictionary.prototype.put = function(key,
value)
Stores the value under the given key and returns the previous value for that key.
mxDictionary.prototype.remove = function(key)
Removes the value for the given key and returns the value that has been removed.
mxDictionary.prototype.getKeys = function()
Returns all keys as an array.
mxDictionary.prototype.getValues = function()
Returns all values as an array.
mxDictionary.prototype.visit = function(visitor)
Visits all entries in the dictionary using the given function with the following signature: function(key, value) where key is a string and value is an object.
Close