Tools.h++ Class Reference

Table Of Contents
Returns TRUE if the collection contains an item which is equal to val. Returns FALSE otherwise.
Equality is measured by the class-defined equality operator.
size_t
entries() const;
Returns the number of items currently in the collection.
RWBoolean
find(const T& target, T& k) const;
Returns TRUE if the collection contains an item which is equal to target and puts the matching
object into k. Returns FALSE otherwise and leaves k untouched. Equality is measured by the
class-defined equality operator.
void
insert(const T& val);
Inserts the value val into the collection.
RWBoolean
isEmpty() const;
Returns TRUE if the collection has no items in it, FALSE otherwise.
size_t
occurrencesOf(const T& val) const;
Returns the number of items in the collection which are equal to val. Equality is measured by the
class-defined equality operator.
RWBoolean
remove(const T& val);
Removes the first object which is equal to the object a and returns TRUE. Returns FALSE if
there is no such object. Equality is measured by the class-defined equality operator.
size_t
removeAll(const T& val);
Removes all objects which are equal to the object a. Returns the number of objects removed.
Equality is measured by the class-defined equality operator.
void
resize(size_t N);
Changes the number of buckets to N, a relatively expensive operation if there are many items in
the collection.