Package | com.threerings.util |
Interface | public interface Map |
Implementors | DictionaryMap, HashMap |
See also
Method | Defined by | ||
---|---|---|---|
clear():void
Clear this map, removing all stored elements.
| Map | ||
containsKey(key:Object):Boolean
Returns true if the specified key exists in the map.
| Map | ||
forEach(fn:Function):void
Call the specified function to iterate over the mappings in this Map.
| Map | ||
get(key:Object):*
Retrieve the value stored in this map for the specified key.
| Map | ||
isEmpty():Boolean
Returns true if this map contains no elements.
| Map | ||
keys():Array
Return all the unique keys in this Map, in Array form.
| Map | ||
put(key:Object, value:Object):*
Store a value in the map associated with the specified key.
| Map | ||
remove(key:Object):*
Removes the mapping for the specified key.
| Map | ||
size():int
Return the current size of the map.
| Map | ||
values():Array
Return all the values in this Map, in Array form.
| Map |
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.
Parameterskey:Object |
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.
fn:Function |
get | () | method |
public function get(key:Object):*
Retrieve the value stored in this map for the specified key. Returns the value, or undefined if there is no mapping for the key.
Parameterskey:Object |
* |
isEmpty | () | method |
public function isEmpty():Boolean
Returns true if this map contains no elements.
ReturnsBoolean |
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.
ReturnsArray |
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.
Parameterskey:Object |
|
value:Object |
* |
remove | () | method |
public function remove(key:Object):*
Removes the mapping for the specified key. Returns the value that had been stored, or undefined.
Parameterskey:Object |
* |
size | () | method |
public function size():int
Return the current size of the map.
Returnsint |
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.
ReturnsArray |