#include <Hashtable.h>
Inheritance diagram for util::Hashtable< key, value >:

It stores key-value pairs and allows look-ups using key values of any type.
Public Methods | |
| Hashtable (unsigned int size=128) | |
| Create a new hash table. | |
| Hashtable (const Hashtable &other) | |
| Copy a hash table. | |
| Hashtable & | operator= (const Hashtable &other) |
| Copy a hash table. | |
| virtual | ~Hashtable () |
| Release the resources allocated by a Hashtable. | |
| virtual value * | get (const key &obj) |
| Get a pointer to a stored object. | |
| virtual void | put (const key &obj, const value &val) |
| Put a new entry into the table. | |
| virtual void | remove (const key &obj) |
| Remove the data referenced by obj. | |
| void | removeValue (const value &obj) |
| Remove the given value from this hash table. | |
| bool | containsKey (const key &obj) |
| Check whether this hash table contains the given reference key. | |
| bool | containsValue (const value &obj) |
| Check whether this hash table contains the given value. | |
| void | clear (void) |
| Clear the table. | |
| void | reset (void) |
| Reset the internal iterator of this Hashtable. | |
| Pair< key, value > * | next (void) |
| Get the next stored item. | |
| bool | hasNext (void) const |
| Check if we still have some items to fetch. | |
| int | getItems () const |
| Get the current number of key-value pairs in the hash table. | |
|
||||||||||
|
Create a new hash table.
|
|
||||||||||
|
Clear the table. All allocated resources will be released. |
|
||||||||||
|
Check whether this hash table contains the given reference key.
|
|
||||||||||
|
Check whether this hash table contains the given value.
|
|
||||||||||
|
Get a pointer to a stored object.
Implements util::Map< key, value >. |
|
||||||||||
|
Get the next stored item. The items are not returned in insertion order. Implements util::Iterator< Pair< key, value > >. |
|
||||||||||||||||
|
Put a new entry into the table. If a value is already mapped to the key, the old value is replaced.
Implements util::Map< key, value >. |
|
||||||||||
|
Remove the data referenced by obj. The memory reserved by the reference key and the actual object is released.
|
|
||||||||||
|
Remove the given value from this hash table. The memory reserved by the reference key and the actual object is released. If the object is a pointer, it must be deleted by the user.
|