Packagecom.threerings.util.maps
Classpublic class HashMap
InheritanceHashMap Inheritance com.threerings.util.maps.AbstractMap
ImplementsMap

Objects that implement Hashable, Strings, and null may be used as keys.



Public Methods
 MethodDefined by
  
HashMap(loadFactor:Number = 1.75)
Construct a HashMap
HashMap
  
clear():void
Clear this map, removing all stored elements.
HashMap
  
containsKey(key:Object):Boolean
Returns true if the specified key exists in the map.
HashMap
  
forEach(fn:Function):void
Call the specified function to iterate over the mappings in this Map.
HashMap
  
get(key:Object):*
HashMap
  
keys():Array
Return all the unique keys in this Map, in Array form.
HashMap
  
put(key:Object, value:Object):*
Store a value in the map associated with the specified key.
HashMap
  
remove(key:Object):*
Removes the mapping for the specified key.
HashMap
  
values():Array
Return all the values in this Map, in Array form.
HashMap
Constructor detail
HashMap()constructor
public function HashMap(loadFactor:Number = 1.75)

Construct a HashMap

Parameters
loadFactor:Number (default = 1.75) — - A measure of how full the hashtable is allowed to get before it is automatically resized. The default value of 1.75 should be fine.
Method detail
clear()method
public function clear():void

Clear this map, removing all stored elements.

containsKey()method 
public function containsKey(key:Object):Boolean

Returns true if the specified key exists in the map.

Parameters
key:Object

Returns
Boolean
forEach()method 
public 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 function get(key:Object):*

Parameters
key:Object

Returns
*
keys()method 
public function keys():Array

Return all the unique keys in this Map, in Array form. The Array is not a 'view': it can be modified without disturbing the Map from whence it came.

Returns
Array
put()method 
public 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 function remove(key:Object):*

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

Parameters
key:Object

Returns
*
values()method 
public function values():Array

Return all the values in this Map, in Array form. The Array is not a 'view': it can be modified without disturbing the Map from whence it came.

Returns
Array