Tools.h++ Class Reference

Table Of Contents
virtual const RWCollectable*
at(size_t i) const;
Allows access to the ith element of the collection. The first variant can be used as an
lvalue, the second cannot. The index i must be between zero and the number of items in
the collection less one, or an exception of type RWBoundsErr will be thrown.
virtual RWCollectable*
first() const = 0;
Returns the first item in the collection.
virtual size_t
index(const RWCollectable* c) const = 0;
Returns the index number of the first item that "matches" the item pointed to by c. If
there is no such item, returns RW_NPOS. For most collections, an item "matches" the
target if either isEqual() or compareTo() find equivalence, whichever is appropriate for
the actual collection type.
void
insertAt(size_t indx, RWCollectable* e);
Adds a new item to the collection at position indx. The item previously at position i is
moved to i+1, etc. The index indx must be between 0 and the number of items in the
collection, or an exception of type RWBoundsErr will be thrown.
virtual RWCollectable*
last() const = 0;
Returns the last item in the collection.
RWCollectable*
prepend(RWCollectable*) = 0;
Adds the item to the beginning of the collection and returns it. Returns nil if the insertion
was unsuccessful.