| Package | system.data.maps |
| Class | public class MultiSetMap |
| Inheritance | MultiSetMap MultiValueMap Object |
Example :
import system.data.Collection ;
import system.data.collections.ArrayCollection ;
import system.data.maps.MultiSetMap ;
var s:MultiSetMap = new MultiSetMap() ;
trace("----- Test put()") ;
trace("insert key1:valueA1 : " + s.put("key1", "valueA1")) ;
trace("insert key1:valueA2 : " + s.put("key1", "valueA2"))
trace("insert key1:valueA2 : " + s.put("key1", "valueA2")) ;
trace("insert key1:valueA3 : " + s.put("key1", "valueA3")) ;
trace("insert key2:valueA2 : " + s.put("key2", "valueA2")) ;
trace("insert key2:valueB1 : " + s.put("key2", "valueB1")) ;
trace("insert key2:valueB2 : " + s.put("key2", "valueB2")) ;
trace("size : " + s.size()) ;
trace("totalSize : " + s.totalSize()) ;
trace("---- Test toArray") ;
var ar:Array = s.toArray() ;
trace("s.toArray : " + ar) ;
trace("----- Test contains") ;
trace("contains valueA1 : " + s.contains("valueA1") ) ;
trace("contains valueA1 in key1 : " + s.containsByKey("key1", "valueA1") ) ;
trace("contains valueA1 in key2 : " + s.containsByKey("key2", "valueA1") ) ;
trace("---- Test removeBy(key, value)") ;
trace("remove key1:valueA2 : " + s.removeByKey("key1", "valueA2")) ;
trace("insert key1:valueA2 : " + s.put("key1", "valueA2")) ;
trace("insert key1:valueA2 : " + s.put("key1", "valueA2")) ;
trace("---- Test remove(key)") ;
trace("remove key2 : " + s.remove("key2")) ;
trace("size : " + s.size()) ;
trace("---- Test putCollection(key, co:Collection)") ;
var co:Collection = new ArrayCollection(["valueA1", "valueA4", "valueA1"]) ;
s.putCollection("key1", co) ;
trace("s : " + s) ;
See also
| Property | Defined By | ||
|---|---|---|---|
| internalBuildClass : Class [override]
Determinates the internal build class used in the createCollection() method to create a new collection to register all values with a new key. | MultiSetMap | ||
| Method | Defined By | ||
|---|---|---|---|
MultiSetMap(map:Map = null, factory:* = null)
Creates a new MultiSetMap instance. | MultiSetMap | ||
clear():void [override]
This clears each collection in the map, and so may be slow. | MultiSetMap | ||
clone():* [override]
Returns the shallow copy of this object. | MultiSetMap | ||
contains(o:*):Boolean
Checks whether the map contains the value specified . | MultiSetMap | ||
containsByKey(key:*, value:*):Boolean
Checks whether the map contains the value specified with the specified key. | MultiSetMap | ||
![]() | containsKey(key:*):Boolean
Checks whether the map contains the key specified. | MultiValueMap | |
![]() | containsValue(value:*):Boolean
Checks whether the map contains the value specified. | MultiValueMap | |
![]() | containsValueByKey(key:*, value:*):Boolean
Checks whether the map contains the value specified or at the specified key contains the value. | MultiValueMap | |
![]() |
Creates a new instance of the map value Collection container. | MultiValueMap | |
![]() | get(key:*):*
Gets the collection mapped to the specified key. | MultiValueMap | |
![]() | getCollection(key:*):Collection
Gets the collection mapped to the specified key. | MultiValueMap | |
![]() | getKeys():Array
Returns an Array containing the combination of all keys in the Map. | MultiValueMap | |
Returns the Set defined in the map with the specified key. | MultiSetMap | ||
![]() | getValues():Array
Returns an Array containing the combination of values from all keys. | MultiValueMap | |
![]() | isEmpty():Boolean
Returns whether this object contains any mappings. | MultiValueMap | |
![]() |
Returns the Iterator representation of the object. | MultiValueMap | |
![]() | iteratorByKey(key:*):Iterator
Gets an Iterator for the collection mapped to the specified key. | MultiValueMap | |
![]() |
Gets an iterator for the map to iterate keys. | MultiValueMap | |
put(key:*, value:*):* [override]
Adds the value to the Set associated with the specified key. | MultiSetMap | ||
![]() |
Override superclass to ensure that MultiMap instances are correctly handled. | MultiValueMap | |
putCollection(key:*, c:Collection):void [override]
Adds a collection of values to the collection associated with the specified key. | MultiSetMap | ||
remove(o:*):* [override]
Removes a specific value from map with a specific key. | MultiSetMap | ||
removeByKey(key:*, value:*):* [override]
Removes a specific value from map with the specific passed-in key value. | MultiSetMap | ||
![]() | size():uint
Returns the size of the collection mapped to the specified key. | MultiValueMap | |
toArray():Array
Returns an Array containing the combination of values from all keys. | MultiSetMap | ||
![]() | toSource(indent:int = 0):String
Returns the source code string representation of the object. | MultiValueMap | |
![]() | toString():String
Returns the string representation of this instance. | MultiValueMap | |
![]() | totalSize():uint
Returns the total size of the map by counting all the values. | MultiValueMap | |
![]() |
Returns the iterator representation of all Collections register in the MultiValueMap, all collections represents a key. | MultiValueMap | |
![]() |
Returns a Collection of all values in the MultiValueMap. | MultiValueMap | |
![]() |
Returns an Iterator representation of all values in the MultiValueMap. | MultiValueMap | |
| internalBuildClass | property |
internalBuildClass:Class[override] Determinates the internal build class used in the createCollection() method to create a new collection to register all values with a new key. The class must implements the Set interface and by default the HashSet class is used.
public function get internalBuildClass():Class public function set internalBuildClass(value:Class):void| MultiSetMap | () | Constructor |
public function MultiSetMap(map:Map = null, factory:* = null)Creates a new MultiSetMap instance.
Example :
import system.data.sets.MultiSetMap ;
var s:MultiSetMap = new MultiSetMap() ;
trace( s ) ;
Parameters map:Map (default = null) — Optional Map reference to initialize and fill this MultiMap.
| |
factory:* (default = null) — Optional Map reference to create the internal Map of the MultiSetMap.
|
| clear | () | method |
override public function clear():voidThis clears each collection in the map, and so may be slow.
| clone | () | method |
override public function clone():*Returns the shallow copy of this object.
Returns* — the shallow copy of this object.
|
| contains | () | method |
public function contains(o:*):BooleanChecks whether the map contains the value specified .
Parameters
o:* — the object to search in this instance.
|
Boolean — true if the MultiSetMap container the passed-in object.
|
| containsByKey | () | method |
public function containsByKey(key:*, value:*):BooleanChecks whether the map contains the value specified with the specified key.
Parameters
key:* — the specified key in the MultiSetMap to search the value.
| |
value:* — the object to search in this instance.
|
Boolean — true if the MultiSetMap container the passed-in object.
|
| getSet | () | method |
public function getSet(key:*):SetReturns the Set defined in the map with the specified key.
Parameters
key:* — the key in the map
|
Set — the Set defined in the map with the specified key.
|
| put | () | method |
override public function put(key:*, value:*):*Adds the value to the Set associated with the specified key.
Parameters
key:* | |
value:* |
* — true if the value is inserted in the object.
|
| putCollection | () | method |
override public function putCollection(key:*, c:Collection):voidAdds a collection of values to the collection associated with the specified key.
Parameters
key:* | |
c:Collection |
| remove | () | method |
override public function remove(o:*):*Removes a specific value from map with a specific key.
Parameters
o:* |
* |
| removeByKey | () | method |
override public function removeByKey(key:*, value:*):*Removes a specific value from map with the specific passed-in key value.
Note : Use Set implementation and not Map implementation !
Parameters
key:* | |
value:* |
* |
| toArray | () | method |
public function toArray():ArrayReturns an Array containing the combination of values from all keys.
ReturnsArray — an Array containing the combination of values from all keys.
|