Package | org.spicefactory.lib.collection |
Class | public class MultiMap |
Inheritance | MultiMap Object |
Due to limitations in the Flash Proxy class which only accepts String-based keys,
the MultiMap
class does not support for
and for each
loops
or bracket access for reading and writing values. For loops you can loop over MultiMap.keys
instead.
Property | Defined By | ||
---|---|---|---|
keys : List [read-only]
All keys of this map in no particular oder. | MultiMap |
Method | Defined By | ||
---|---|---|---|
MultiMap()
Creates a new instance. | MultiMap | ||
add(key:Object, value:*):void
Adds a value to the list of items mapped to the specified key. | MultiMap | ||
containsKey(key:Object):Boolean
Indicates whether this map contains at least one value mapped to the specified key. | MultiMap | ||
Returns all items mapped to the specified key as a List. | MultiMap | ||
isEmpty():Boolean
Indicates whether this map is empty. | MultiMap | ||
remove(key:Object, value:*):void
Removes a value from the list of items mapped to the specified key. | MultiMap | ||
removeAll():void
Removes all items from this map. | MultiMap | ||
removeKey(key:Object):void
Removes all items mapped to the specified key. | MultiMap | ||
size():uint
Returns the number of keys in this map. | MultiMap |
keys | property |
keys:List
[read-only] All keys of this map in no particular oder.
public function get keys():List
MultiMap | () | Constructor |
public function MultiMap()
Creates a new instance.
add | () | method |
public function add(key:Object, value:*):void
Adds a value to the list of items mapped to the specified key.
Parameters
key:Object — the key the list of items is mapped to
| |
value:* — the value to add to the list of objects mapped to the specified key
|
containsKey | () | method |
public function containsKey(key:Object):Boolean
Indicates whether this map contains at least one value mapped to the specified key.
Parameters
key:Object — the key to check
|
Boolean — true if this map contains at least one value mapped to the specified key
|
getAll | () | method |
public function getAll(key:Object):List
Returns all items mapped to the specified key as a List.
Parameters
key:Object — the key to return all mapped items for
|
List — all items mapped to the specified key as a List
|
isEmpty | () | method |
public function isEmpty():Boolean
Indicates whether this map is empty.
ReturnsBoolean — true if this map does not contain any items.
|
remove | () | method |
public function remove(key:Object, value:*):void
Removes a value from the list of items mapped to the specified key.
Parameters
key:Object — the key the list of items is mapped to
| |
value:* — the value to remove from the list of objects mapped to the specified key
|
removeAll | () | method |
public function removeAll():void
Removes all items from this map.
removeKey | () | method |
public function removeKey(key:Object):void
Removes all items mapped to the specified key.
Parameters
key:Object — the key to remove
|
size | () | method |
public function size():uint
Returns the number of keys in this map.
Returnsuint — the number of keys in this map
|