#include <skHashTable.h>
Inheritance diagram for skTHashTable< TKey, TValue >:

Public Member Functions | |
| skTHashTable (USize size) | |
| constructs the table with the given size | |
| skTHashTable () | |
| default constructor which constructs a table with 3 entries | |
| ~skTHashTable () | |
| destructor - destroys the keys and values in the table | |
| void | insertKeyAndValue (TKey *key, TValue *value) |
| this method adds the given key and value to the table. | |
| TValue * | value (const TKey *key) |
| returns the value associated with the given key (or 0) | |
| void | del (const TKey *key) |
| deletes the key and value from the table | |
| void | delKeyNotValue (const TKey *key) |
| deletes the key but not the value from the table | |
| void | remove (const TKey *key) |
| removes but does not delete the value and key | |
Protected Member Functions | |
| int | compareKeys (const void *key1, const void *key2) const |
| this method compares two instances of the key. | |
| void | deleteKey (void *key) |
| deletes the given key (casting it appropriately) | |
| void | deleteValue (void *value) |
| deletes the given value (casting it appropriately) | |
| USize | hashKey (const void *key) const |
| returns a hash value for the given key, calling a global function USize ::hashKey(TKey * key) | |
|
||||||||||||||||
|
this method compares two instances of the key. It uses the == operator for the class Implements skHashTable. |
|
||||||||||||||||
|
this method adds the given key and value to the table. If the key is already in the table, the existing version is first deleted
|
1.3