Packagecom.threerings.util.maps
Classpublic class WeakValueMap
InheritanceWeakValueMap Inheritance com.threerings.util.maps.ForeachingMap

A Map that stores weak values. If the values are not referenced anywhere else in the runtime, this Map may unexpectedly shrink in size.



Public Methods
 MethodDefined by
  
WeakValueMap(source:Map)
WeakValueMap
  
containsKey(key:Object):Boolean
Returns true if the specified key exists in the map.
WeakValueMap
  
forEach(fn:Function):void
Call the specified function to iterate over the mappings in this Map.
WeakValueMap
  
get(key:Object):*
WeakValueMap
  
put(key:Object, value:Object):*
Store a value in the map associated with the specified key.
WeakValueMap
  
remove(key:Object):*
Removes the mapping for the specified key.
WeakValueMap
  
size():int
Return the current size of the map.
WeakValueMap
Constructor detail
WeakValueMap()constructor
public function WeakValueMap(source:Map)Parameters
source:Map
Method detail
containsKey()method
public override function containsKey(key:Object):Boolean

Returns true if the specified key exists in the map.

Parameters
key:Object

Returns
Boolean
forEach()method 
public override function forEach(fn:Function):void

Call the specified function to iterate over the mappings in this Map. Signature: function (key :Object, value :Object) :void or function (key :Object, value :Object) :Boolean If you return a Boolean, you may return true to indicate that you've found what you were looking for, and halt iteration.

Parameters
fn:Function
get()method 
public override function get(key:Object):*

Parameters
key:Object

Returns
*
put()method 
public override function put(key:Object, value:Object):*

Store a value in the map associated with the specified key. Returns the previous value stored for that key, or undefined.

Parameters
key:Object
 
value:Object

Returns
*
remove()method 
public override function remove(key:Object):*

Removes the mapping for the specified key. Returns the value that had been stored, or undefined.

Parameters
key:Object

Returns
*
size()method 
public override function size():int

Return the current size of the map.

Returns
int