SLHashTable Class Reference
#include <SLHashTable.hpp>
Collaboration diagram for SLHashTable:
[legend]List of all members.
Detailed Description
A NO-Template Hash Table object. Its structure and behaviour are a bit stollen to its Java couterpart.
Example of code using hash table :
To allow a classe to be a key or a value, this class has to implement the abstract class SLHashTable::Element.
Example for class SLString that implements SLHashTable::Element :
Member Typedef Documentation
|
This is the type for all computed hash codes |
Constructor & Destructor Documentation
SLHashTable::SLHashTable |
( |
unsigned long |
DEFAULT_LENGTH = 32 |
) |
|
|
|
Construct the hash table with an initial default capacity |
Member Function Documentation
HashCode SLHashTable::computeHashCode |
( |
const char * |
key, |
|
|
unsigned long |
size |
|
) |
[static] |
|
|
This static method compute a hashcode for any char * string given its size. - Parameters:
-
key | is a char * string (may be casted from another type) |
size | is the size in bytes of key (not including '\0' !) |
- Returns:
- 0 if key is NULL or size is 0
|
|
Retrieve an element from the hash table - Exceptions:
-
SLHashTable::NotFoundException | when key is not found. |
|
|
put an element associated with key into the table. Replaced values are destroyed. |
void SLHashTable::rehash |
( |
|
) |
[protected] |
|
|
Rehash the hashtable when thresold is exceeded. |
void SLHashTable::remove |
( |
const Element & |
key |
) |
|
|
|
Supress an element from the table. Its destructor will be called. If element is not found, nothing happens. |
Member Data Documentation
|
table length used by default |
|
load factor used by default |
The documentation for this class was generated from the following file:
Generated on Mon Apr 19 01:03:36 2004 for segusoLand by
1.3.6-20040222