Tools.h++ Manual

21-66 104011 Tandem Computers Incorporated
21
virtual size_t entries() const = 0;
Returns the total number of items in the collection.
virtual RWCollectable* find(const RWCollectable*
target) const = 0;
Returns a pointer to the first item in the collection which "matches" the object
pointed to by
target
or nil if no item was found. For most collections, an
item "matches" the target if either
isEqual()
or
compareTo()
find
equivalence, whichever is appropriate for the actual collection type. However,
the "identity collections" (i.e.,
RWIdentitySet
and
RWIdentityDictionary
)
look for an item with the same address (i.e., "is identical to").
virtual unsigned hash() const;
Inherited from class RWCollectable.
virtual RWCollectable* insert(RWCollectable* e) = 0;
Adds an item to the collection and returns a pointer to it. If the item is already
in the collection, some items return the old instance, others return nil.
virtual RWClassID isA() const;
Redefined from class
RWCollectable
to return
__RWCOLLECTION
.
virtual RWBoolean isEmpty() const = 0;
Returns
TRUE
if the collection is empty, otherwise returns
FALSE
.
virtual RWBoolean isEqual(const RWCollectable* a)
const;
Inherited from class
RWCollectable
.
virtual size_t occurrencesOf(const
RWCollectable* t) const = 0;
Returns the number of items in the collection which are "matches"
t
. See
function
find()
for a definition of matches.
virtual voidrestoreGuts(RWFile&);
Redefined to repeatedly call the global operator
RWvistream& operator>>(RWvistream&, RWCollectable*&);
followed by
insert (RWCollectable*)
for each item in the collection.
virtual voidrestoreGuts(RWvistream&);
Redefined to repeatedly call the global operator
RWvistream& operator>>(RWvistream&, RWCollectable*&);
followed by
insert(RWCollectable*)
for each item in the collection.