A hash table using direct lookup (perfect hashing). Each key can only map one value at a time and multiple keys can map the same value. The HashMap is preallocated according to an initial size, but afterwards automatically resized if the number of key-value pairs exceeds the predefined size.
HashMap | A hash table using direct lookup (perfect hashing). |
Functions | |
HashMap | Initializes a new HashMap instance. |
insert | Inserts a key/data couple into the table. |
find | Finds the value that is associated with the given key. |
remove | Removes a value based on a given key. |
containsKey | Checks if a mapping exists for the given key. |
getKeySet | Writes all keys into an array. |
contains | @inheritDoc |
clear | @inheritDoc |
getIterator | @inheritDoc |
Properties | |
size | @inheritDoc |
Functions | |
isEmpty | @inheritDoc |
toArray | @inheritDoc |
toString | Prints out a string representing the current object. |
dump | Prints out all elements (for debug/demo purposes). |
Initializes a new HashMap instance.
public function HashMap( size: int = 500 )
Inserts a key/data couple into the table.
public function insert( key: *, obj: * ):Boolean
Finds the value that is associated with the given key.
public function find( key: * ):*
Removes a value based on a given key.
public function remove( key: * ):*
Checks if a mapping exists for the given key.
public function containsKey( key: * ):Boolean
Writes all keys into an array.
public function getKeySet():Array
@inheritDoc
public function contains( obj: * ):Boolean
@inheritDoc
public function clear():void
@inheritDoc
public function getIterator():Iterator
@inheritDoc
public function get size():int
@inheritDoc
public function isEmpty():Boolean
@inheritDoc
public function toArray():Array
Prints out a string representing the current object.
public function toString():String
Prints out all elements (for debug/demo purposes).
public function dump():String