Packageorg.spicefactory.lib.collection
Classpublic class MultiMap
InheritanceMultiMap Inheritance Object

Map implementation that maps each key to one or more items. Within the Spicefactory libraries and frameworks these collections are usually only used inside the implementations, but not exposed in the public APIs.

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.



Public Properties
 PropertyDefined By
  keys : List
[read-only] All keys of this map in no particular oder.
MultiMap
Public Methods
 MethodDefined By
  
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
  
getAll(key:Object):List
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
Property Detail
keysproperty
keys:List  [read-only]

All keys of this map in no particular oder.


Implementation
    public function get keys():List
Constructor Detail
MultiMap()Constructor
public function MultiMap()

Creates a new instance.

Method Detail
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

Returns
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

Returns
List — all items mapped to the specified key as a List
isEmpty()method 
public function isEmpty():Boolean

Indicates whether this map is empty.

Returns
Boolean — 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.

Returns
uint — the number of keys in this map