A hashtable stores an arbitrary number of objects that are accessed using an arbitrary key. The key is converted to an integer value, so so-called hash value, by the hash function. A hash function should be fast and should map the keys to integers in a highly irregular but consistent way, i.~e., the keys should be distributed evenly over the whole set of integers. Ideally, objects can then be accessed in constant time based on their key.
|
checks if the hashtable contains the specified key.
|
|
checks if the hashtable contains a specific value. Objects are compared by the standard C operator == and this method is Expensive!!!
|
|
deletes the hashtable, but can't free the memory for the content.
|
|
calls the function `f(key,value)' for each item in the hashtable.
Referenced by strFinalize(). |
|
calls the function `f(key, value)' for each item in the Hashtable. deletes the hashtable and hashtable becomes inaccessible
Referenced by strFinalize(). |
|
List hashForEachFree(), but frees only the embedded value. F is applied to the value only and must be a unariy void function. Definition at line 475 of file hashtable.c. |
|
calls the function `f(element,data)' for each object in the hashtable.
|
|
retrieves value associated with the key.
Referenced by _strLookup(). |
|
retrieves value associated with the key
|
|
checks if the hashtable is empty.
|
|
deletes and frees hash iterator object
|
|
returns a new hash iterator object. Iterators allow to loop through all the elements of a container. However the behaviour is undefined if the container changes while the iterator is still looping.
hi = hashIteratorNew(ht); while (NULL != (key = hashIteratorNextKey(hi))) { do something with key; } hashIteratorDelete(hi);
|
|
returns the next key of a hash-iterator. Hash iterator points to the following entry afterwards
|
|
returns the next value of a hash-iterator. Hash iterator points to the following entry afterwards.
|
|
retrieves a list of keys of all objects in the hashtable.
References listPrependElement(). Referenced by strFinalize(). |
|
creates a new hashtable with an initial capacity of c. whenever the number of stored objects exceeds loadFactor times the current capacity, the hashtable is automatically resized.
References primeNext(). Referenced by strInitialize(). |
|
removes key/value pair from hashtable
Referenced by strDelete(). |
|
adds the object value with the key key in the hashtable. rehashes the hashtable if necessary.
References rehashHashtable(). Referenced by strRegister(). |
|
retrieves the size of the hashtable
Referenced by strFinalize(), and strStoreSize(). |
|
is an example equality function for C strings that can be used in hashNew.
Referenced by strInitialize(). |
|
is an example has function for C strings that can be used in hashNew. A bit rotating function by Knuth is used here. TODO:
Referenced by strInitialize(). |
|
rehashes the hashtable. doubles the capacity and this enlarges the space.
References primeNext(). Referenced by hashSet(). |