Tools.h++ Class Reference

Table Of Contents
sag because each bucket must be searched linearly. The number of buckets can be changed by
calling member function resize(). This will require that all objects be rehashed.
The iterator for this class is RWHashTableIterator.
Persistence
None
Example
#include <rw/hashtab.h>
#include <rw/colldate.h>
#include <rw/rstream.h>
main(){
RWHashTable table;
RWCollectableDate *july
= new RWCollectableDate(7, "July", 1990);
RWCollectableDate *may
= new RWCollectableDate (1, "May", 1977);
RWCollectableDate *feb
= new RWCollectableDate (22, "Feb", 1983);
RWCollectableDate *aug
= new RWCollectableDate (2, "Aug", 1966);
table.insert(july);
table.insert(may);
table.insert(feb);
table.insert(aug);
cout << "Table contains " << table.entries() << " entries.\n";
RWCollectableDate key(22, "Feb", 1983);
cout << "It does ";
if (!table.contains(&key)) cout << "not ";
cout << "contain the key " << key << endl;
delete july;
delete may;
delete feb;
delete aug;
return 0;
}