Tools.h++ Manual
21-116 104011 Tandem Computers Incorporated
21
RWHashDictionary
RWHashDictionary
|
RWSet
|
RWHashTable
|
RWCollection
|
RWCollectable
Synopsis
typedef RWHashDictionary Dictionary; // Smalltalk typedef.
#include <rw/hashdict.h>
RWHashDictionary a;
Description A
RWHashDictionary
represents a group of unordered values, accessible by
external keys. Duplicate keys are not allowed. Class
RWHashDictionary
is
implemented as a hash table of associations of keys and values. Both the key
and the value must inherit from abstract the base class
RWCollectable
, with
a suitable deļ¬nition of the virtual function
hash()
and
isEqual()
for the
key.
This class corresponds to the Smalltalk class
Dictionary
.
Public constructors
RWHashDictionary(size_t n = RWDEFAULT_CAPACITY);
Construct an empty hashed dictionary using
n
hashing buckets.
RWHashDictionary(const RWHashDictionary& hd);
Copy constructor. A shallow copy of the collection
hd
is made.