class hashtable

A hashtable.

Inheritance:


Public Methods

[more] hashtable()
[more] hashtable(unsigned int buckets, float loadlimit = DEFAULT_HASH_LOAD)
Load/bucket values must be greater than 0.
[more] hashtable(const hashtable &src)
Copies the structure only
[more]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.
[more]object* remove(const object &key)
Remove returns the saved instance of the key, or NULL if the key is not found
[more]object* erase(const object& key)
As remove, but the value is deleted if found
[more]object* find(const object &key) const
Returns NULL if key not found
[more]inline unsigned int keyCount() const
[more]object** getKeys() const
Returns an arraoy of key objects.
[more]void clear()
Deletes all buckets, sets the table key count to 0.
[more] ~hashtable()
Deletes the hashtable structure, keys and values remain intact


Inherited from object:

Public Methods

ovirtual bool operator==(const object &obj) const
ovirtual bool operator!=(const object &obj) const
ovirtual unsigned int hashcode() const
ovirtual object* clone() const


Documentation

A hashtable. Key equivalence is defined by the = (const object &) operator. Hash codes are obtained by calling key.hashcode ()
o hashtable()

o 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.

o hashtable(const hashtable &src)
Copies the structure only

oobject* 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.

oobject* remove(const object &key)
Remove returns the saved instance of the key, or NULL if the key is not found

oobject* erase(const object& key)
As remove, but the value is deleted if found

oobject* find(const object &key) const
Returns NULL if key not found

oinline unsigned int keyCount() const

oobject** 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 [].

ovoid clear()
Deletes all buckets, sets the table key count to 0. Has no effect on key/value objects.

o ~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++.