Packagealternativa.types
Classpublic dynamic class Map
InheritanceMap Inheritance flash.utils.Dictionary

A map that has objects as a keys.



Public Properties
 PropertyDefined by
  length : uint
[read-only] Get quantity of map elements.
Map
Public Methods
 MethodDefined by
  
Map(weakKeys:Boolean = false)
Create an instance of class.
Map
  
add(key:*, value:*):void
Add a key-value pair.
Map
  
any():*
Get any object.
Map
  
clear():void
Clear all map objects.
Map
  
Clone map.
Map
  
concat(m:Map):void
Add map.
Map
  
hasKey(key:*):Boolean
Check for the map key.
Map
  
hasValue(value:*):Boolean
Value existence check.
Map
  
isEmpty():Boolean
Check map on elements' existence
Map
  
isSingle():Boolean
Check if map has the only element.
Map
  
peek():*
Get some map object.
Map
  
remove(key:*):void
Delete object by the key.
Map
  
take():*
Get some map object and delete it.
Map
  
toArray(numeric:Boolean = false):Array
Create new array based on map.
Map
  
toSet(weakKeys:Boolean = false):Set
Transfer to a set.
Map
  
toString():String
String representation of the map.
Map
Property detail
lengthproperty
length:uint  [read-only]

Get quantity of map elements.

Implementation
    public function get length():uint
Constructor detail
Map()constructor
public function Map(weakKeys:Boolean = false)

Create an instance of class.

Parameters
weakKeys:Boolean (default = false)if parameter is set to true, weak keys will be used
Method detail
add()method
public function add(key:*, value:*):void

Add a key-value pair. If the given key already exits, the new value will be set.

Parameters
key:*key
 
value:*value
any()method 
public function any():*

Get any object.

Returns
*any object of the map
clear()method 
public function clear():void

Clear all map objects.

clone()method 
public function clone():Map

Clone map.

Returns
Mapa clone of the map
concat()method 
public function concat(m:Map):void

Add map.

Parameters
m:Mapmap, elements of which are being added
hasKey()method 
public function hasKey(key:*):Boolean

Check for the map key.

Parameters
key:*the key that is being added

Returns
Booleantrue if the map contains specified key or false otherwise
hasValue()method 
public function hasValue(value:*):Boolean

Value existence check.

Parameters
value:*value which is being checked for existence

Returns
Booleantrue if the map contains an element equal to value, false otherwise
isEmpty()method 
public function isEmpty():Boolean

Check map on elements' existence

Returns
Booleantrue if there is no elements in the map, false otherwise
isSingle()method 
public function isSingle():Boolean

Check if map has the only element.

Returns
Booleantrue if there is only element in the map, false otherwise
peek()method 
public function peek():*

Get some map object.

Returns
*a value from the map
remove()method 
public function remove(key:*):void

Delete object by the key.

Parameters
key:*key
take()method 
public function take():*

Get some map object and delete it.

Returns
*a value from the map
toArray()method 
public function toArray(numeric:Boolean = false):Array

Create new array based on map.

Parameters
numeric:Boolean (default = false)if paramener is set to true, the map will be transferred to an indexed array, otherwise to an associative array with string keys

Returns
Arraya new array containing all values from the map
toSet()method 
public function toSet(weakKeys:Boolean = false):Set

Transfer to a set.

Parameters
weakKeys:Boolean (default = false)weak keys flag for a new set

Returns
Seta set containig all values of the map
toString()method 
public function toString():String

String representation of the map.

Returns
Stringa string representation of the map