Tools.h++ Manual
22-88 104011 Tandem Computers Incorporated
22
RWBoolean contains(const K& key) const;
Returns
TRUE
if the dictionary contains a key which is equal to key. Returns
FALSE
otherwise. Equality is measured by the class-defined equality operator
for class
K
.
size_t entries() const;
Returns the number of key-value pairs currently in the dictionary.
RWBoolean find(const K& key, K& retKey)
const;
Returns
TRUE
if the dictionary contains a key which is equal to
key
and puts
the matching key into
retKey
. Returns
FALSE
otherwise and leaves
retKey
untouched. Equality is measured by the class-defined equality operator for
class
K
.
RWBoolean findValue(const K& key, V&
retVal) const;
Returns
TRUE
if the dictionary contains a key which is equal to
key
and puts
the associated value into
retVal
. Returns
FALSE
otherwise and leaves
retVal
untouched. Equality is measured by the class-defined equality
operator for class
K
.
RWBoolean findKeyAndValue(const K& key, K&
retKey, V& retVal) const;
Returns
TRUE
if the dictionary contains a key which is equal to
key
and puts
the matching key into
retKey
and the associated value into
retVal
. Returns
FALSE
otherwise and leaves
retKey
and
retVal
untouched. Equality is
measured by the class-defined equality operator for class
K
.
void insertKeyAndValue(const K&
key, V value);
Inserts the key key and value value into the dictionary.
RWBoolean isEmpty() const;
Returns
TRUE
if the dictionary has no items in it,
FALSE
otherwise.
RWBoolean remove(const K& key);
Returns
TRUE
and removes the (key/value) pair where the key is equal to the
key
. Returns
FALSE
if there is no such key. Equality is measured by the class-
defined equality operator for class
K
.