#include <HashSet.h>
Inheritance diagram for ICStringKeyHashSet:
Definition at line 325 of file HashSet.h.
Public Member Functions | |
void | Add (const char *key) |
Adds a key to the hash set. | |
bool | Contains (const char *key) const |
Returns, if the hash set contains a given key. | |
bool | ContainsKey (void *key) const |
Returns, if the hash table contains a given key. | |
bool | ContainsKey (const char *key) const |
Returns, if the hash table contains a given key. | |
void | Delete (void *key) |
Removes a key/value pair from the hash table. | |
void | Delete (const char *key) |
Removes a key/value pair from the hash table. | |
void | DeleteAll () |
Removes all key/value pairs from the hash table. | |
Void * | Get (void *key) const |
Returns the value of a key/value pair by its key. | |
Void * | Get (const char *key) const |
Returns the value of a key/value pair by its key. | |
PointeredList * | GetAll () const |
Returns a new PointeredList of all keys currently in the hash set. | |
long | GetCount () const |
Returns the number of set keys. | |
int | GetDesiredFillRatio () const |
Returns the fill ratio after a hash table resize. | |
int | GetFillRatio () const |
Returns the current fill ratio. | |
PointeredList * | GetKeys () const |
Returns a new PointeredList of all keys currently in the hash table. | |
long | GetSize () const |
Returns the number of buckets currently used. | |
PointeredList * | GetValues () const |
Returns a new PointeredList of all values currently in the hash table. | |
ICStringKeyHashSet (long initSize, int desiredFillRatio) | |
Creates a new ignore case string key hash set with customized settings. | |
ICStringKeyHashSet (long initSize) | |
Creates a new ignore case string key hash set with an initial size. | |
ICStringKeyHashSet () | |
Creates a new ignore case string key hash set. | |
bool | IsEmpty () const |
Returns whether there are no elements in the hash table. | |
void | Remove (const char *key) |
Removes a key from the hash set. | |
void | RemoveAll () |
Removes all keys from the hash set. | |
void | Set (void *key, Void *Value) |
Sets a key/value pair into the hash table. | |
void | Set (const char *key, Void *Value) |
Sets a key/value pair into the hash table. | |
Void * | Unset (void *key) |
Removes a key/value pair from the hash table. | |
Void * | Unset (const char *key) |
Removes a key/value pair from the hash table. | |
void | UnsetAll () |
Removes all key/value pairs from the hash table. | |
virtual | ~ICStringKeyHashSet () |
Destroys the ignore case string key hash set. | |
Protected Member Functions | |
virtual void * | CreateKey (void *key) const |
Creates the key object that shall be stored in the key buckets. | |
virtual void | DestroyKey (void *key) const |
Disposes a key created by the CreateKey method. | |
virtual bool | Equals (void *key1, void *key2) const |
Checks, if to keys equal each other. | |
virtual unsigned long | HashCode (void *key) const |
Returns the hash code of the key. | |
Protected Attributes | |
PointeredList ** | KeyBuckets |
The array of key buckets. | |
long | Size |
The number of buckets currently used. | |
PointeredList ** | ValueBuckets |
The array of value buckets. |
|
Creates a new ignore case string key hash set.
|
|
Creates a new ignore case string key hash set with an initial size.
|
|
Creates a new ignore case string key hash set with customized settings.
|
|
Destroys the ignore case string key hash set. The memory of the keys is not freed, since it was not acquired, |
|
Adds a key to the hash set. Afterwards, the method checks if the hash set has to be resized.
|
|
Returns, if the hash set contains a given key.
|
|
Returns, if the hash table contains a given key.
|
|
Returns, if the hash table contains a given key.
|
|
Creates the key object that shall be stored in the key buckets. The method receives a key and e.g. creates a clone, or uses the key directly, if this is possible. The Equals and HashCode method must return the same values when using the original key and the one returned by this method. The DestroyKey method disposes this key again. In the StringKeyHashMap class, this method clones the key, since it is a string (const char *).
Reimplemented from HashMap< Void >. |
|
Removes a key/value pair from the hash table. The memory of the key is not freed, since it was not acquired, but the memory of the value is freed.
|
|
Removes a key/value pair from the hash table. The original memory of the key provided when setting the key/value is not freed, since the StringKeyHashMap uses a private copy of it.
|
|
Removes all key/value pairs from the hash table. The memory of the keys is not freed, since it was not acquired, but the memory of the values is freed. |
|
Disposes a key created by the CreateKey method. This can be done by freeing the memory, if the key was cloned, or by simply doing nothing, if the user's key was directly used. This method should do the opposite of the CreateKey method. In the StringKeyHashMap class, this method frees the memory, since the CreateKey method created it.
Reimplemented from HashMap< Void >. |
|
Checks, if to keys equal each other. In the StringKeyHashMap class, this is true, if they contain the same characters.
Reimplemented from StringKeyHashMap< Void >. |
|
Returns the value of a key/value pair by its key.
|
|
Returns the value of a key/value pair by its key.
|
|
Returns a new PointeredList of all keys currently in the hash set.
|
|
Returns the number of set keys.
Reimplemented in HashSet. |
|
Returns the fill ratio after a hash table resize.
|
|
Returns the current fill ratio. This is the ratio between the used hash table cells (Count), and the reserved cells (Size).
|
|
Returns a new PointeredList of all keys currently in the hash table.
|
|
Returns the number of buckets currently used.
|
|
Returns a new PointeredList of all values currently in the hash table.
|
|
Returns the hash code of the key. This is a value that has to be constant for the same key all the time, needs not to be injective, and should distribute the keys quite good.
Reimplemented from StringKeyHashMap< Void >. |
|
Returns whether there are no elements in the hash table.
Reimplemented in HashSet. |
|
Removes a key from the hash set. Afterwards, the method checks if the hash set has to be resized. The memory of the key is not freed.
|
|
Removes all keys from the hash set. Afterwards, the method checks if the hash set has to be resized. The memory of the key is not freed. |
|
Sets a key/value pair into the hash table. Afterwards, the method checks if the hash table has to be resized. If the key existed, the old value is replaced, and its memory is freed.
|
|
Sets a key/value pair into the hash table. Afterwards, the method checks if the hash table has to be resized. If the key existed, the old value is replaced, and its memory is freed.
|
|
Removes a key/value pair from the hash table. Afterwards, the method checks if the hash table has to be resized. Both the memory of the key and the memory of the value are not freed, but the value is returned.
|
|
Removes a key/value pair from the hash table. Afterwards, the method checks if the hash table has to be resized. Both the memory of the key and the memory of the value are not freed, but the value is returned.
|
|
Removes all key/value pairs from the hash table. Afterwards, the method checks if the hash table has to be resized. Both the memory of the keys and the memory of the values are not freed.
|
|
The array of key buckets.
|
|
The number of buckets currently used.
|
|
The array of value buckets.
|