Package | org.as3collections.utils |
Class | public class MapUtil |
Inheritance | MapUtil Object |
IMap
interface.
Method | Defined By | ||
---|---|---|---|
MapUtil()
MapUtil is a static class and shouldn't be instantiated. | MapUtil | ||
[static]
Performs an arbitrary, specific evaluation of equality between this object and the other object. | MapUtil | ||
[static]
Performs an arbitrary, specific evaluation of equality between this object and the other object. | MapUtil | ||
feedMapWithXmlList(map:IMap, list:XMLList, typeCoercion:Boolean = true):void [static]
Feeds argument map with argument list. | MapUtil | ||
[static]
Returns a new TypedListMap with the wrapMap argument wrapped. | MapUtil | ||
[static]
Returns a new TypedMap with the wrapMap argument wrapped. | MapUtil | ||
[static]
Returns a new TypedSortedMap with the wrapMap argument wrapped. | MapUtil | ||
[static]
Returns the string representation of the map argument. | MapUtil |
MapUtil | () | Constructor |
public function MapUtil()
MapUtil
is a static class and shouldn't be instantiated.
IllegalOperationError — MapUtil is a static class and shouldn't be instantiated.
|
equalConsideringOrder | () | method |
public static function equalConsideringOrder(map1:IMap, map2:IMap):Boolean
Performs an arbitrary, specific evaluation of equality between this object and the other
object.
If one of the maps or both maps are null
it will be returned false
.
Two different objects are considered equal if:
This implementation takes care of the order of the mappings in the maps. So, for two maps are equal the order of entries returned by the iterator object must be equal.
Parameters
map1:IMap — the first map.
| |
map2:IMap — the second map.
|
Boolean — true if the arbitrary evaluation considers the objects equal.
|
equalNotConsideringOrder | () | method |
public static function equalNotConsideringOrder(map1:IMap, map2:IMap):Boolean
Performs an arbitrary, specific evaluation of equality between this object and the other
object.
If one of the maps or both maps are null
it will be returned false
.
Two different objects are considered equal if:
This implementation does not takes care of the order of the mappings in the map.
Parameters
map1:IMap — the first map.
| |
map2:IMap — the second map.
|
Boolean — true if the arbitrary evaluation considers the objects equal.
|
feedMapWithXmlList | () | method |
public static function feedMapWithXmlList(map:IMap, list:XMLList, typeCoercion:Boolean = true):void
Feeds argument map
with argument list
.
The name of the nodes become keys and the values of the nodes become values of the IMap
object.
Parameters
map:IMap — the map to be fed.
| |
list:XMLList — the list to retrieve entries.
| |
typeCoercion:Boolean (default = true ) — if true performs a type coercion to Boolean if some String is "true" or "false", or a type coercion to Number if some String is a Number (i.e. !isNaN(Number(string)) == true) .
|
import org.as3collections.maps.HashMap; import org.as3collections.utils.MapUtil; var map:IMap = new HashMap(); var xml:XML = <index><key1>value1</key1><key2>value2</key2></index>; MapUtil.feedMapFromXmlList(map, xml.children()); trace(map); // [key1=value1,key2=value2]
getTypedListMap | () | method |
public static function getTypedListMap(wrapMap:IListMap, typeKeys:*, typeValues:*):TypedListMap
Returns a new TypedListMap
with the wrapMap
argument wrapped.
Parameters
wrapMap:IListMap — the target map to be wrapped by the TypedListMap .
| |
typeKeys:* — the type of the keys allowed by the returned TypedListMap .
| |
typeValues:* — the type of the values allowed by the returned TypedListMap .
|
TypedListMap — a new TypedListMap with the wrapMap argument wrapped.
|
ArgumentError — if the wrapMap argument is null .
| |
ArgumentError — if the typeKeys argument is null .
| |
ArgumentError — if the typeValues argument is null .
| |
org.as3coreaddendum.errors:ClassCastError — if the types of one or more keys or values in the wrapMap argument are incompatible with the typeKeys or typeValues argument.
|
getTypedMap | () | method |
public static function getTypedMap(wrapMap:IMap, typeKeys:*, typeValues:*):TypedMap
Returns a new TypedMap
with the wrapMap
argument wrapped.
Parameters
wrapMap:IMap — the target map to be wrapped by the TypedMap .
| |
typeKeys:* — the type of the keys allowed by the returned TypedMap .
| |
typeValues:* — the type of the values allowed by the returned TypedMap .
|
TypedMap — a new TypedMap with the wrapMap argument wrapped.
|
ArgumentError — if the wrapMap argument is null .
| |
ArgumentError — if the typeKeys argument is null .
| |
ArgumentError — if the typeValues argument is null .
| |
org.as3coreaddendum.errors:ClassCastError — if the types of one or more keys or values in the wrapMap argument are incompatible with the typeKeys or typeValues argument.
|
getTypedSortedMap | () | method |
public static function getTypedSortedMap(wrapMap:ISortedMap, typeKeys:*, typeValues:*):TypedSortedMap
Returns a new TypedSortedMap
with the wrapMap
argument wrapped.
Parameters
wrapMap:ISortedMap — the target map to be wrapped by the TypedSortedMap .
| |
typeKeys:* — the type of the keys allowed by the returned TypedSortedMap .
| |
typeValues:* — the type of the values allowed by the returned TypedSortedMap .
|
TypedSortedMap — a new TypedSortedMap with the wrapMap argument wrapped.
|
ArgumentError — if the wrapMap argument is null .
| |
ArgumentError — if the typeKeys argument is null .
| |
ArgumentError — if the typeValues argument is null .
| |
org.as3coreaddendum.errors:ClassCastError — if the types of one or more keys or values in the wrapMap argument are incompatible with the typeKeys or typeValues argument.
|
toString | () | method |
public static function toString(map:IMap):String
Returns the string representation of the map
argument.
Parameters
map:IMap — the target map.
|
String — the string representation of the target map.
|