Dillo v3.1.1-117-gc0464026
|
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. | |
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. | |
virtual bool | equals (Object *other) |
Returns, whether two objects are equal. | |
virtual int | hashValue () |
Return a hash value for the object. | |
virtual Object * | clone () |
Return an exact copy of the object. | |
const char * | toString () |
Use object::Object::intoStringBuffer to return a textual representation of the object. | |
virtual size_t | sizeOf () |
Return the number of bytes, this object totally uses. | |
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.
Definition at line 305 of file container.hh.
lout::container::untyped::HashTable::HashTable | ( | bool | ownerOfKeys, |
bool | ownerOfValues, | ||
int | tableSize = 251 |
||
) |
Definition at line 637 of file container.cc.
References ownerOfValues.
lout::container::untyped::HashTable::~HashTable | ( | ) |
Definition at line 643 of file container.cc.
References lout::container::untyped::HashSet::Node::next, ownerOfValues, PRINTF, lout::container::untyped::HashSet::table, lout::container::untyped::HashSet::tableSize, and lout::object::Object::toString().
|
protectedvirtual |
Reimplemented from lout::container::untyped::HashSet.
Definition at line 664 of file container.cc.
References lout::container::untyped::HashSet::clearNode(), ownerOfValues, PRINTF, and lout::object::Object::toString().
|
protectedvirtual |
Reimplemented from lout::container::untyped::HashSet.
Definition at line 659 of file container.cc.
Object * lout::container::untyped::HashTable::get | ( | object::Object * | key | ) | const |
Definition at line 708 of file container.cc.
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.
Definition at line 676 of file container.cc.
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 | ||
) |
Definition at line 702 of file container.cc.
References lout::container::untyped::HashSet::insertNode(), and lout::container::untyped::HashTable::KeyValuePair::value.
|
private |
Definition at line 308 of file container.hh.
Referenced by clearNode(), HashTable(), and ~HashTable().