Dillo v3.1.1-111-gd4f56d0d
|
A hash set. More...
#include <container.hh>
Classes | |
class | HashSetIterator |
struct | Node |
Public Member Functions | |
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 | |
void | intoStringBuffer (misc::StringBuffer *sb) |
Store a textual representation of the object in a misc::StringBuffer. | |
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 | |
int | calcHashValue (object::Object *object) const |
virtual Node * | createNode () |
virtual void | clearNode (Node *node) |
Node * | findNode (object::Object *object) const |
Node * | insertNode (object::Object *object) |
AbstractIterator * | createIterator () |
Protected Attributes | |
Node ** | table |
int | tableSize |
int | numElements |
bool | ownerOfObjects |
Friends | |
class | HashSetIterator |
A hash set.
Definition at line 245 of file container.hh.
lout::container::untyped::HashSet::HashSet | ( | bool | ownerOfObjects, |
int | tableSize = 251 |
||
) |
Definition at line 446 of file container.cc.
References lout::container::untyped::Vector::numElements, and lout::container::untyped::Vector::ownerOfObjects.
lout::container::untyped::HashSet::~HashSet | ( | ) |
Definition at line 458 of file container.cc.
References lout::container::untyped::HashSet::Node::next, lout::container::untyped::HashSet::Node::object, lout::container::untyped::Vector::ownerOfObjects, PRINTF, and lout::object::Object::toString().
|
inlineprotected |
Definition at line 261 of file container.hh.
References lout::object::Object::hashValue(), and tableSize.
|
protectedvirtual |
Reimplemented in lout::container::untyped::HashTable.
Definition at line 493 of file container.cc.
References lout::container::untyped::HashSet::Node::object, lout::container::untyped::Vector::ownerOfObjects, PRINTF, and lout::object::Object::toString().
Referenced by lout::container::untyped::HashTable::clearNode().
bool lout::container::untyped::HashSet::contains | ( | object::Object * | key | ) | const |
Definition at line 537 of file container.cc.
References lout::object::Object::equals(), and lout::container::untyped::HashSet::Node::next.
|
protectedvirtual |
Implements lout::container::untyped::Collection0.
Definition at line 628 of file container.cc.
|
protectedvirtual |
Reimplemented in lout::container::untyped::HashTable.
Definition at line 488 of file container.cc.
|
protected |
Definition at line 501 of file container.cc.
References lout::object::Object::equals(), and lout::container::untyped::HashSet::Node::next.
Referenced by lout::container::untyped::HashTable::get().
|
protected |
Definition at line 512 of file container.cc.
References lout::container::untyped::HashSet::Node::next, lout::container::untyped::Vector::numElements, and lout::container::untyped::HashSet::Node::object.
Referenced by lout::container::untyped::HashTable::put().
void lout::container::untyped::HashSet::put | ( | object::Object * | object | ) |
Definition at line 532 of file container.cc.
bool lout::container::untyped::HashSet::remove | ( | object::Object * | key | ) |
Definition at line 548 of file container.cc.
References lout::object::Object::equals(), lout::container::untyped::HashSet::Node::next, lout::container::untyped::Vector::numElements, and lout::container::untyped::HashSet::Node::object.
|
virtual |
Implements lout::container::untyped::Collection.
Definition at line 483 of file container.cc.
References lout::container::untyped::Vector::numElements.
|
friend |
Definition at line 247 of file container.hh.
|
protected |
Definition at line 258 of file container.hh.
|
protected |
Definition at line 259 of file container.hh.
|
protected |
Definition at line 257 of file container.hh.
Referenced by lout::container::untyped::HashTable::intoStringBuffer(), and lout::container::untyped::HashTable::~HashTable().
|
protected |
Definition at line 258 of file container.hh.
Referenced by calcHashValue(), lout::container::untyped::HashTable::intoStringBuffer(), and lout::container::untyped::HashTable::~HashTable().