Dillo
|
A hash table. More...
#include <container.hh>
Classes | |
struct | KeyValuePair |
Public Member Functions | |
HashTable (bool ownerOfKeys, bool ownerOfValues, int tableSize=251) | |
~HashTable () | |
void | intoStringBuffer (misc::StringBuffer *sb) |
Store a textual representation of the object in a misc::StringBuffer. More... | |
void | put (object::Object *key, object::Object *value) |
object::Object * | get (object::Object *key) const |
Public Member Functions inherited from lout::container::untyped::HashSet | |
HashSet (bool ownerOfObjects, int tableSize=251) | |
~HashSet () | |
int | size () |
void | put (object::Object *object) |
bool | contains (object::Object *key) const |
bool | remove (object::Object *key) |
Public Member Functions inherited from lout::container::untyped::Collection | |
Iterator | iterator () |
Public Member Functions inherited from lout::object::Object | |
virtual | ~Object () |
The destructor is defined as virtual (but not abstract), so that destruction of Object's works properly. More... | |
virtual bool | equals (Object *other) |
Returns, whether two objects are equal. More... | |
virtual int | hashValue () |
Return a hash value for the object. More... | |
virtual Object * | clone () |
Return an exact copy of the object. More... | |
const char * | toString () |
Use object::Object::intoStringBuffer to return a textual representation of the object. More... | |
virtual size_t | sizeOf () |
Return the number of bytes, this object totally uses. More... | |
Protected Member Functions | |
Node * | createNode () |
void | clearNode (Node *node) |
Protected Member Functions inherited from lout::container::untyped::HashSet | |
int | calcHashValue (object::Object *object) const |
Node * | findNode (object::Object *object) const |
Node * | insertNode (object::Object *object) |
AbstractIterator * | createIterator () |
Private Attributes | |
bool | ownerOfValues |
Additional Inherited Members | |
Protected Attributes inherited from lout::container::untyped::HashSet | |
Node ** | table |
int | tableSize |
int | numElements |
bool | ownerOfObjects |
A hash table.
lout::container::untyped::HashTable::HashTable | ( | bool | ownerOfKeys, |
bool | ownerOfValues, | ||
int | tableSize = 251 |
||
) |
References ownerOfValues.
lout::container::untyped::HashTable::~HashTable | ( | ) |
|
protectedvirtual |
Reimplemented from lout::container::untyped::HashSet.
References lout::container::untyped::HashSet::clearNode(), ownerOfValues, PRINTF, and lout::object::Object::toString().
|
protectedvirtual |
Reimplemented from lout::container::untyped::HashSet.
Object * lout::container::untyped::HashTable::get | ( | object::Object * | key | ) | const |
References lout::container::untyped::HashSet::findNode().
|
virtual |
Store a textual representation of the object in a misc::StringBuffer.
This is used by object::Object::toString.
Reimplemented from lout::container::untyped::Collection.
References lout::misc::StringBuffer::append(), lout::object::Object::intoStringBuffer(), lout::container::untyped::HashSet::Node::next, lout::container::untyped::HashSet::table, and lout::container::untyped::HashSet::tableSize.
void lout::container::untyped::HashTable::put | ( | object::Object * | key, |
object::Object * | value | ||
) |
|
private |
Referenced by clearNode(), HashTable(), and ~HashTable().