Tools.h++ Class Reference

Table Of Contents
size_t
length() const;
Returns the number of items currently in the collection.
size_t
occurrencesOf(const T& a) const;
Performs a binary search, returning the number of items that are equal to a. Equality is measured
by the class-defined equality operator.
RWBoolean
remove(const T& a);
Performs a binary search, removing 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& a);
Removes all items which are equal to a, returning the number removed. Equality is measured by
the class-defined equality operator.
T
removeAt(size_t i);
Removes and returns the object at index i. An exception of type RWBoundsError will be thrown
if i is not a valid index. Valid indices are from zero to the number of items in the list less one.
T
removeFirst();
Removes and returns the first object in the collection. An exception of type RWBoundsError will
be thrown if the list is empty.
T
removeLast();
Removes and returns the last object in the collection. An exception of type RWBoundsError will
be thrown if the list is empty.
void
resize(size_t N);
Changes the capacity of the collection to N. Note that the number of objects in the collection
does not change, just the capacity.
Related Global Operators
RWvostream&
operator<<(RWvostream& strm,
const RWTValSortedVector<T>& coll);
RWFile&
operator<<(RWFile& strm, const RWTValSortedVector<T>& coll);
Saves the collection coll onto the output stream strm, or a reference to it if it has already been