The ‘HashMap’ class stores data in key/value pairs.
com.boostworthy.collections.ICollection
HashMap | The ‘HashMap’ class stores data in key/value pairs. |
Variables | |
m_aKeys | An array for storing map keys. |
m_aValues | An array for storing map values. |
Functions | |
HashMap | Constructor. |
clone | Creates a new hash map that is a clone of this collection. |
put | Adds a new key and value pair to this collection. |
putMap | Iterates through all accessible properties/elements of the specified object and adds each one as a key/value pair to this collection. |
get | Gets the value that is paired with the specified key. |
remove | Removes the specified key and it’s corresponding value from this collection. |
containsKey | Checks to see if this collection contains the specified key. |
Properties | |
length | Gets the length of this collection. |
Functions | |
getIterator | Returns an iterator of the specified type. |
getKeyIterator | Returns an iterator of the specified type for iterating through keys. |
getValueIterator | Returns an iterator of the specified type for iterating through values. |
dispose | Performs any appropriate clean-up tasks for garbage collection such as removing event listeners, setting object references to ‘null’, etc. |
init | Initializes this object. |
searchForKey | Searches through the keys array to see if the key is being stored by this object. |
public function getIterator( uIterator: uint = 2 ):IIterator
Returns an iterator of the specified type.
param | uIterator The iterator type to use for iterating through the data being stored by this collection. Default is ‘2’ (IteratorType.ARRAY_FORWARD). |
An iterator instance of the specified type.
com.boostworthy.collections.iterators.IteratorType
public function getKeyIterator( uIterator: uint = 2 ):IIterator
Returns an iterator of the specified type for iterating through keys.
param | uIterator The iterator type to use for iterating through the keys being stored by this collection. Default is ‘2’ (IteratorType.ARRAY_FORWARD). |
An iterator instance of the specified type.
com.boostworthy.collections.iterators.IteratorType
public function getValueIterator( uIterator: uint = 2 ):IIterator
Returns an iterator of the specified type for iterating through values.
param | uIterator The iterator type to use for iterating through the values being stored by this collection. Default is ‘2’ (IteratorType.ARRAY_FORWARD). |
An iterator instance of the specified type.
com.boostworthy.collections.iterators.IteratorType
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.
param | objKey The key being searched for. |
The index that the key is being stored at in the keys array.
com.boostworthy.core.Global.NULL_INDEX
An array for storing map keys.
protected var m_aKeys: Array
An array for storing map values.
protected var m_aValues: Array
Constructor.
public function HashMap( objMap: Object = null )
Creates a new hash map that is a clone of this collection.
public function clone():HashMap
Adds a new key and value pair to this collection.
public function put( objKey: Object, objValue: Object ):void
Iterates through all accessible properties/elements of the specified object and adds each one as a key/value pair to this collection.
public function putMap( objMap: Object ):void
Gets the value that is paired with the specified key.
public function get( objKey: Object ):Object
Removes the specified key and it’s corresponding value from this collection.
public function remove( objKey: Object ):void
Checks to see if this collection contains the specified key.
public function containsKey( objKey: Object ):Boolean
Gets the length of this collection.
public function get length():uint
Returns an iterator of the specified type.
public function getIterator( uIterator: uint = 2 ):IIterator
Returns an iterator of the specified type for iterating through keys.
public function getKeyIterator( uIterator: uint = 2 ):IIterator
Returns an iterator of the specified type for iterating through values.
public function getValueIterator( uIterator: uint = 2 ):IIterator
Performs any appropriate clean-up tasks for garbage collection such as removing event listeners, setting object references to ‘null’, etc.
public function dispose():void
Initializes this object.
protected function init( objMap: Object ):void
Searches through the keys array to see if the key is being stored by this object.
protected function searchForKey( objKey: Object ):int