Dillo v3.1.1-119-g140d9ebd
Loading...
Searching...
No Matches
lout::container::untyped::HashSet Class Reference

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 Objectclone ()
 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 NodecreateNode ()
 
virtual void clearNode (Node *node)
 
NodefindNode (object::Object *object) const
 
NodeinsertNode (object::Object *object)
 
AbstractIteratorcreateIterator ()
 

Protected Attributes

Node ** table
 
int tableSize
 
int numElements
 
bool ownerOfObjects
 

Friends

class HashSetIterator
 

Detailed Description

A hash set.

Definition at line 245 of file container.hh.

Constructor & Destructor Documentation

◆ HashSet()

lout::container::untyped::HashSet::HashSet ( bool  ownerOfObjects,
int  tableSize = 251 
)

◆ ~HashSet()

Member Function Documentation

◆ calcHashValue()

int lout::container::untyped::HashSet::calcHashValue ( object::Object object) const
inlineprotected

Definition at line 261 of file container.hh.

References lout::object::Object::hashValue(), and tableSize.

◆ clearNode()

void lout::container::untyped::HashSet::clearNode ( HashSet::Node node)
protectedvirtual

◆ contains()

bool lout::container::untyped::HashSet::contains ( object::Object key) const

◆ createIterator()

Collection0::AbstractIterator * lout::container::untyped::HashSet::createIterator ( )
protectedvirtual

Implements lout::container::untyped::Collection0.

Definition at line 628 of file container.cc.

◆ createNode()

HashSet::Node * lout::container::untyped::HashSet::createNode ( )
protectedvirtual

Reimplemented in lout::container::untyped::HashTable.

Definition at line 488 of file container.cc.

◆ findNode()

HashSet::Node * lout::container::untyped::HashSet::findNode ( object::Object object) const
protected

◆ insertNode()

◆ put()

void lout::container::untyped::HashSet::put ( object::Object object)

Definition at line 532 of file container.cc.

◆ remove()

◆ size()

int lout::container::untyped::HashSet::size ( )
virtual

Friends And Related Symbol Documentation

◆ HashSetIterator

friend class HashSetIterator
friend

Definition at line 247 of file container.hh.

Member Data Documentation

◆ numElements

int lout::container::untyped::HashSet::numElements
protected

Definition at line 258 of file container.hh.

◆ ownerOfObjects

bool lout::container::untyped::HashSet::ownerOfObjects
protected

Definition at line 259 of file container.hh.

◆ table

Node** lout::container::untyped::HashSet::table
protected

◆ tableSize

int lout::container::untyped::HashSet::tableSize
protected

The documentation for this class was generated from the following files: