Using this class has a penalty in performance and code beauty. Only use this when you are keeping a map for a long time and will be removing items and adding items with new names (not previously used) repeatedly.
Users of this class should not perform any browser detection themselves, as this is handled internally, and normal maps are returned for browsers that do not leak memory.
Attributes | Name and Description |
---|---|
|
caplin.core.MapFactory()
This is a utility class and does not need to be constructed. |
Attributes | Name and Description |
---|---|
<static>
|
caplin.core.MapFactory.REMOVAL_LIMIT
A constant that defines the number of removals (as performed with .removeItem) before the map is replaced with a new one. |
Attributes | Name and Description |
---|---|
<static>
|
Object
createMap()
Creates a map that doesn't leak when used in conjunction with .removeItem. |
<static>
|
Object
removeItem(Object mMap, String sKey)
Removes an item from the map. |
►
caplin.core.MapFactory()
This is a utility class and does not need to be constructed.
►
<static>
int
caplin.core.MapFactory.REMOVAL_LIMIT
A constant that defines the number of removals (as performed with .removeItem) before the map is replaced with a new one.
►
<static>
Object
createMap()
Creates a map that doesn't leak when used in conjunction with .removeItem.
MapFactory
to determine when any clean-up should occur, or a
normal map object for browsers that do not leak.
►
<static>
Object
removeItem(Object mMap, String sKey)
Removes an item from the map.
If cleanup occurs, then the map will be replaced with a completely new one, and so any references to the map must be reset
whenever this method is called, for example: this.m_mMap = caplin.core.MapFactory.removeItem(this.m_mMap, sItemKey);
Object | mMap | The map the item will be removed from. |
String | sKey | The key of the item to be removed from the map. |
mMap
, but may be a new map reference if the map has
been replaced with a new instance.