A hashtable.
Inheritance:
Public Methods
-
hashtable()
-
hashtable(unsigned int buckets, float loadlimit = DEFAULT_HASH_LOAD)
- Load/bucket values must be greater than 0.
-
hashtable(const hashtable &src)
- Copies the structure only
-
object* insert(object* key, object* value)
- Add item, returns the previous instance of an item with that key, or NULL if no such item exists.
-
object* remove(const object &key)
- Remove returns the saved instance of the key, or NULL if the key is not found
-
object* erase(const object& key)
- As remove, but the value is deleted if found
-
object* find(const object &key) const
- Returns NULL if key not found
-
inline unsigned int keyCount() const
-
object** getKeys() const
- Returns an arraoy of key objects.
-
void clear()
- Deletes all buckets, sets the table key count to 0.
-
~hashtable()
- Deletes the hashtable structure, keys and values remain intact
Inherited from object:
Public Methods
-
virtual bool operator==(const object &obj) const
-
virtual bool operator!=(const object &obj) const
-
virtual unsigned int hashcode() const
-
virtual object* clone() const
Documentation
A hashtable. Key equivalence is defined by the = (const object &) operator.
Hash codes are obtained by calling key.hashcode ()
hashtable()
hashtable(unsigned int buckets, float loadlimit = DEFAULT_HASH_LOAD)
-
Load/bucket values must be greater than 0. Load must be less than 1.0.
Invalid arguments will have undefined effects.
hashtable(const hashtable &src)
- Copies the structure only
object* insert(object* key, object* value)
-
Add item, returns the previous instance of an item with that key,
or NULL if no such item exists. NULL pointers can not be keys or
values.
object* remove(const object &key)
-
Remove returns the saved instance of the key, or NULL if the
key is not found
object* erase(const object& key)
-
As remove, but the value is deleted if found
object* find(const object &key) const
- Returns NULL if key not found
inline unsigned int keyCount() const
object** getKeys() const
-
Returns an arraoy of key objects. Keys are owned by the hashtable
and should not be deleted. The array is owned by the caller and can be
removed with a call to delete [].
void clear()
-
Deletes all buckets, sets the table key count to 0. Has no effect on
key/value objects.
~hashtable()
- Deletes the hashtable structure, keys and values remain intact
- This class has no child classes.
Alphabetic index HTML hierarchy of classes or Java
This page was generated with the help of DOC++.