Packagecom.boostworthy.collections
Classpublic class HashMap
ImplementsICollection, IDisposable

The 'HashMap' class stores data in key/value pairs.

See also

com.boostworthy.collections.ICollection


Public Properties
 PropertyDefined by
  length : uint
[read-only] Gets the length of this collection.
HashMap
Protected Properties
 PropertyDefined by
  m_aKeys : Array
An array for storing map keys.
HashMap
  m_aValues : Array
An array for storing map values.
HashMap
Public Methods
 MethodDefined by
  
HashMap(objMap:Object = null)
Constructor.
HashMap
  
Creates a new hash map that is a clone of this collection.
HashMap
  
containsKey(objKey:Object):Boolean
Checks to see if this collection contains the specified key.
HashMap
  
dispose():void
Performs any appropriate clean-up tasks for garbage collection such as removing event listeners, setting object references to 'null', etc.
HashMap
  
get(objKey:Object):Object
Gets the value that is paired with the specified key.
HashMap
  
getIterator(uIterator:uint = 2):IIterator
Returns an iterator of the specified type.
HashMap
  
getKeyIterator(uIterator:uint = 2):IIterator
Returns an iterator of the specified type for iterating through keys.
HashMap
  
getValueIterator(uIterator:uint = 2):IIterator
Returns an iterator of the specified type for iterating through values.
HashMap
  
put(objKey:Object, objValue:Object):void
Adds a new key and value pair to this collection.
HashMap
  
putMap(objMap:Object):void
Iterates through all accessible properties/elements of the specified object and adds each one as a key/value pair to this collection.
HashMap
  
remove(objKey:Object):void
Removes the specified key and it's corresponding value from this collection.
HashMap
Protected Methods
 MethodDefined by
  
init(objMap:Object):void
Initializes this object.
HashMap
  
searchForKey(objKey:Object):int
Searches through the keys array to see if the key is being stored by this object.
HashMap
Property detail
lengthproperty
length:uint  [read-only]

Gets the length of this collection.

Implementation
    public function get length():uint
m_aKeysproperty 
protected var m_aKeys:Array

An array for storing map keys.

m_aValuesproperty 
protected var m_aValues:Array

An array for storing map values.

Constructor detail
HashMap()constructor
public function HashMap(objMap:Object = null)

Constructor.

Parameters
objMap:Object (default = null)
Method detail
clone()method
public function clone():HashMap

Creates a new hash map that is a clone of this collection.

Returns
HashMap — A new hash map that is a clone of this collection.
containsKey()method 
public function containsKey(objKey:Object):Boolean

Checks to see if this collection contains the specified key.

Parameters
objKey:Object — The key being searched for.

Returns
Boolean — A boolean value of 'true' if the key exists, 'false' if it does not.
dispose()method 
public function dispose():void

Performs any appropriate clean-up tasks for garbage collection such as removing event listeners, setting object references to 'null', etc.

get()method 
public function get(objKey:Object):Object

Gets the value that is paired with the specified key. If not such key exists, 'null' is returned.

Parameters
objKey:Object — They key to use to retrieve a value.

Returns
Object — The value that was paired with the specified key.
getIterator()method 
public function getIterator(uIterator:uint = 2):IIterator

Returns an iterator of the specified type.

Parameters
uIterator:uint (default = 2) — The iterator type to use for iterating through the data being stored by this collection. Default is '2' (IteratorType.ARRAY_FORWARD).

Returns
IIterator — An iterator instance of the specified type.

See also

getKeyIterator()method 
public function getKeyIterator(uIterator:uint = 2):IIterator

Returns an iterator of the specified type for iterating through keys.

Parameters
uIterator:uint (default = 2) — The iterator type to use for iterating through the keys being stored by this collection. Default is '2' (IteratorType.ARRAY_FORWARD).

Returns
IIterator — An iterator instance of the specified type.

See also

getValueIterator()method 
public function getValueIterator(uIterator:uint = 2):IIterator

Returns an iterator of the specified type for iterating through values.

Parameters
uIterator:uint (default = 2) — The iterator type to use for iterating through the values being stored by this collection. Default is '2' (IteratorType.ARRAY_FORWARD).

Returns
IIterator — An iterator instance of the specified type.

See also

init()method 
protected function init(objMap:Object):void

Initializes this object.

Parameters
objMap:Object
put()method 
public function put(objKey:Object, objValue:Object):void

Adds a new key and value pair to this collection.

Parameters
objKey:Object — The key to use to retrieve the value.
 
objValue:Object — The value to store.
putMap()method 
public function putMap(objMap:Object):void

Iterates through all accessible properties/elements of the specified object and adds each one as a key/value pair to this collection.

Parameters
objMap:Object — The object to extract key/value pairs from.
remove()method 
public function remove(objKey:Object):void

Removes the specified key and it's corresponding value from this collection.

Parameters
objKey:Object — The key to be removed.
searchForKey()method 
protected function searchForKey(objKey:Object):int

Searches through the keys array to see if the key is being stored by this object. If the key is found, it's index in the keys array is returned. If the key is not found, the null index value is returned.

Parameters
objKey:Object — The key being searched for.

Returns
int — The index that the key is being stored at in the keys array.

See also