| Package | com.developmentarc.framework.datastructures.utils |
| Class | public class HashTable |
| Property | Defined by | ||
|---|---|---|---|
| isEmpty : Boolean [read-only]
Used to determine if there are currently item pairs in the table.
| HashTable | ||
| length : int [read-only]
Returns the number of items currently inside the HashTable.
| HashTable | ||
| Method | Defined by | ||
|---|---|---|---|
|
Constructor for the HashTable.
| HashTable | ||
|
addItem(key:*, item:*):void
Adds a key/item pair to the HashTable.
| HashTable | ||
|
containsItem(item:*):Boolean
Looks up the requested item and returns true if the item is contained, false if it is not.
| HashTable | ||
|
containsKey(key:*):Boolean
Looks up the requested key and returns true if the key is contained, false if it is not.
| HashTable | ||
|
getAllItems():Array
Returns all items stored in the HashTable.
| HashTable | ||
|
getAllKeys():Array
Returns all keys stored in the HashTable.
| HashTable | ||
|
getItem(key:*):*
Returns the item for the specified key, if the key is not found then the method returns null.
| HashTable | ||
|
getKeyAt(position:int):*
Returns the key at a specified position if the HashTable has that position available.
| HashTable | ||
|
remove(key:*):void
Removes an item/key pair based on the key provided.
| HashTable | ||
|
removeAll():void
Removes all items and keys from the HashTable.
| HashTable | ||
| isEmpty | property |
isEmpty:Boolean [read-only]Used to determine if there are currently item pairs in the table.
Implementation public function get isEmpty():Boolean
| length | property |
length:int [read-only]Returns the number of items currently inside the HashTable.
Implementation public function get length():int
| HashTable | () | constructor |
public function HashTable()Constructor for the HashTable.
| addItem | () | method |
public function addItem(key:*, item:*):voidAdds a key/item pair to the HashTable. This enables the ability to lookup items by key or position. This also enables keys to be found by items or position.
Parameterskey:* |
|
item:* |
| containsItem | () | method |
public function containsItem(item:*):BooleanLooks up the requested item and returns true if the item is contained, false if it is not.
Parametersitem:* — Item to lookup.
|
Boolean — True if found, false if not.
|
| containsKey | () | method |
public function containsKey(key:*):BooleanLooks up the requested key and returns true if the key is contained, false if it is not.
Parameterskey:* — Key to lookup.
|
Boolean — True if found, false if not.
|
| getAllItems | () | method |
public function getAllItems():ArrayReturns all items stored in the HashTable. The returned Array is a clone of the stored array to prevent key pair corruption.
ReturnsArray — Array of all the contained items.
|
| getAllKeys | () | method |
public function getAllKeys():ArrayReturns all keys stored in the HashTable. The returned Array is a clone of the stored array to prevent key pair corruption.
ReturnsArray — Array of all the contained keys.
|
| getItem | () | method |
public function getItem(key:*):*Returns the item for the specified key, if the key is not found then the method returns null.
Parameterskey:* — Key object to look up item.
|
* — Item bound to key.
|
| getKeyAt | () | method |
public function getKeyAt(position:int):*Returns the key at a specified position if the HashTable has that position available.
Parametersposition:int — Position to return key.
|
* — Key at specified position.
|
| remove | () | method |
public function remove(key:*):voidRemoves an item/key pair based on the key provided.
Parameterskey:* — Key to remove item on.
|
| removeAll | () | method |
public function removeAll():voidRemoves all items and keys from the HashTable.