Tools.h++ Manual

104011 Tandem Computers Incorporated 21-5
21
virtual unsigned hash() const;
Inherited from class
RWCollectable
.
virtual RWCollectable* insert(RWCollectable* c);
Redefined from class
RWCollection
. Inserts the item c into the collection and
returns it, or if an item was already in the collection that isEqual to c, then
returns the old item and increments its count.
RWCollectable* insertWithOccurrences
(RWCollectable*c,size_t n);
Inserts the item
c
into the collection with count
n
and returns it, or if an item
was already in the collection that isEqual to
c
, then returns the old item and
increments its count by
n
.
virtual RWClassID isA() const;
Redefined from class
RWCollectable
to return
__RWBAG
.
virtual RWBoolean isEmpty() const;
Redefined from class
RWCollection
.
virtual RWBoolean isEqual(const RWCollectable*
a)const;
Inherited from class
RWCollectable
.
virtual size_t occurrencesOf(const
RWCollectable* target) const;
Redefined from class
RWCollection
. Returns the number of items that are
equal to the item pointed to by
target
.
virtual RWCollectable* remove(const RWCollectable*
target);
Redefined from class
RWCollection
. Removes and returns the item that
isEqual to the item pointed to by
target
. Returns nil if no item was found.
virtual void removeAndDestroy(const
RWCollectable* target);
Inherited from class
RWCollection
.
void resize(size_t n = 0);
Resizes the internal hash table to have
n
buckets. This will require rehashing
all the members of the collection. If
n
is zero, then an appropriate size will be
picked automatically.