CountMap¶
Overview¶
Data structure that handles creating/destroying related objects that need to exist when something's count is >=1
@author Jonathan Olson <jonathan.olson@colorado.edu>
Class CountMap¶
Constructor¶
new CountMap( create, destroy )¶
Instance Methods¶
increment( key, quantity )¶
@param {*} key @param {number} [quantity]
decrement( key, quantity )¶
@param {*} key @param {number} [quantity]
get( key )¶
clear()¶
NOTE: We COULD try to collect all of the CountMapEntries... but that seems like an awful lot of CPU. If GC is an issue from this, we can add more logic
Source Code¶
See the source for CountMap.js in the scenery repository.