Packagevegas.data.map
Classpublic dynamic class HashMap
InheritanceHashMap Inheritance flash.utils.Proxy
ImplementsMap

This class is not the same AS2 vegas.data.map.HashMap, see ArrayMap to compare AS2 and AS3 class.

Example :

     package 
     {
             
        import flash.display.Sprite;
        import flash.utils.
        
        import vegas.data.Map ;
        import vegas.data.map.HashMap;
        import vegas.data.iterator.Iterator;
        
        public class TestHashMap extends Sprite
        {
        
            public function TestHashMap() 
            {
                  
              var map:Map = new HashMap() ;
              trace("> put key1 -> value0 : " + map.put("key1", "value0") ) ;
              trace("> put key1 -> value1 : " + map.put("key1", "value1") ) ;            
              trace("> put key2 -> value2 : " + map.put("key2", "value2") ) ;
                            
              trace("> map : " + map) ;
              trace("> map toSource : " + map.toSource()) ;
     
              trace("> iterator") ;
              var it:Iterator = map.iterator() ;
              while(it.hasNext()) 
              {
                  var v:= it.next() ;
                  var k:= it.key() ;
                  trace( "   -> " + k + " : " + v ) ;
              }
                            
              trace("> remove key1 : " + map.remove("key1")) ;
              trace("> size : " + map.size()) ;      
                            
              map.clear() ;  
                            
              trace("> isEmpty : " + map.isEmpty()) ;      
                            
           }
        }
     



Public Methods
 MethodDefined by
  
HashMap(... arguments)
Creates a new HashMap instance.
HashMap
  
clear():void
Removes all mappings from this map.
HashMap
  
clone():*
Returns a shallow copy of this HashMap instance: the keys and values themselves are not cloned.
HashMap
  
containsKey(key:*):Boolean
Returns true if this map contains a mapping for the specified key.
HashMap
  
containsValue(value:*):Boolean
Returns true if this map maps one or more keys to the specified value.
HashMap
  
copy():*
Returns a deep copy ot this HashMap instance.
HashMap
  
get(key:*):*
Returns the value to which this map maps the specified key.
HashMap
  
getKeys():Array
Returns an array representation of all keys in the map.
HashMap
  
getValues():Array
Returns an array representation of all values in the map.
HashMap
  
hashCode():uint
Returns a hashcode value for the object.
HashMap
  
isEmpty():Boolean
Returns true if this map contains no key-value mappings.
HashMap
  
Returns the values iterator of this map.
HashMap
  
Returns the keys iterator of this map.
HashMap
  
put(key:*, value:*):*
Associates the specified value with the specified key in this map.
HashMap
  
putAll(m:Map):void
Copies all of the mappings from the specified map to this one.
HashMap
  
remove(o:*):*
Removes the mapping for this key from this map if present.
HashMap
  
size():uint
Returns the number of key-value mappings in this map.
HashMap
  
toSource(indent:int = 0):String
Returns the eden String representation of this map.
HashMap
  
toString():String
Returns the String representation of this map.
HashMap
Protected Methods
 MethodDefined by
  
callProperty(methodName:*, ... rest):*
Overrides the behavior of an object property that can be called as a function.
HashMap
  
deleteProperty(name:*):Boolean
Invoked when a property is deleted in the hashmap.
HashMap
  
getProperty(name:*):*
If the property can't be found, the method returns undefined.
HashMap
  
setProperty(name:*, value:*):void
If the property can't be found, this method creates a property with the specified name and value.
HashMap
Constructor detail
HashMap()constructor
public function HashMap(... arguments)

Creates a new HashMap instance.

Parameters
... arguments
Method detail
callProperty()method
flash_proxy override function callProperty(methodName:*, ... rest):*

Overrides the behavior of an object property that can be called as a function. When a method of the object is invoked, this method is called. While some objects can be called as functions, some object properties can also be called as functions.

Parameters
methodName:*
 
... rest

Returns
*
clear()method 
public function clear():void

Removes all mappings from this map.

clone()method 
public function clone():*

Returns a shallow copy of this HashMap instance: the keys and values themselves are not cloned.

Returns
* — a shallow copy of this HashMap instance: the keys and values themselves are not cloned.
containsKey()method 
public function containsKey(key:*):Boolean

Returns true if this map contains a mapping for the specified key.

Parameters
key:*

Returns
Boolean — true if this map contains a mapping for the specified key.
containsValue()method 
public function containsValue(value:*):Boolean

Returns true if this map maps one or more keys to the specified value.

Parameters
value:*

Returns
Boolean — true if this map maps one or more keys to the specified value.
copy()method 
public function copy():*

Returns a deep copy ot this HashMap instance.

Returns
* — a deep copy ot this HashMap instance.
deleteProperty()method 
flash_proxy override function deleteProperty(name:*):Boolean

Invoked when a property is deleted in the hashmap.

         import vegas.data.map.HashMap;
         
         var map:HashMap = new HashMap() ;
         
         trace("> put key1 -> value1 : " + map.put("key1", "value1") ) ;
         trace("> put key2 -> value2 : " + map.put("key2", "value2") ) ;
         
         trace("> map : " + map) ;
         
         var isDeleted:Boolean = delete map["key1"] ;
         
         trace("> remove key1 : " + isDeleted ) ;
         
         trace("> map : " + map) ;
         

Parameters
name:*

Returns
Booleantrue if the key is removed.
get()method 
public function get(key:*):*

Returns the value to which this map maps the specified key.

Parameters
key:*

Returns
* — the value to which this map maps the specified key.
getKeys()method 
public function getKeys():Array

Returns an array representation of all keys in the map.

Returns
Array — an array representation of all keys in the map.
getProperty()method 
flash_proxy override function getProperty(name:*):*

If the property can't be found, the method returns undefined. For more information on this behavior, see the ECMA-262 Language Specification, 3rd Edition.

Parameters
name:*

Returns
*
getValues()method 
public function getValues():Array

Returns an array representation of all values in the map.

Returns
Array — an array representation of all values in the map.
hashCode()method 
public function hashCode():uint

Returns a hashcode value for the object.

Returns
uint — a hashcode value for the object.
isEmpty()method 
public function isEmpty():Boolean

Returns true if this map contains no key-value mappings.

Returns
Boolean — true if this map contains no key-value mappings.
iterator()method 
public function iterator():Iterator

Returns the values iterator of this map.

Returns
Iterator — the values iterator of this map.
keyIterator()method 
public function keyIterator():Iterator

Returns the keys iterator of this map.

Returns
Iterator — the keys iterator of this map.
put()method 
public function put(key:*, value:*):*

Associates the specified value with the specified key in this map.

Parameters
key:*
 
value:*

Returns
*
putAll()method 
public function putAll(m:Map):void

Copies all of the mappings from the specified map to this one.

Parameters
m:Map
remove()method 
public function remove(o:*):*

Removes the mapping for this key from this map if present.

Parameters
o:*

Returns
*
setProperty()method 
flash_proxy override function setProperty(name:*, value:*):void

If the property can't be found, this method creates a property with the specified name and value.

Parameters
name:* — The name of the property to modify.
 
value:* — The value to set the property to.
size()method 
public function size():uint

Returns the number of key-value mappings in this map.

Returns
uint — the number of key-value mappings in this map.
toSource()method 
public function toSource(indent:int = 0):String

Returns the eden String representation of this map.

Parameters
indent:int (default = 0)

Returns
String — the eden String representation of this map.
toString()method 
public function toString():String

Returns the String representation of this map.

Returns
String — the String representation of this map.