Tools.h++ Class Reference

Table Of Contents
Click on the banner to return to the Class Reference home page.
©Copyright 1996 Rogue Wave Software
RWSortedVector
RWSortedVector RWOrdered RWSequenceable ...
...RWCollection RWCollectable
Synopsis
Description
Persistence
Example
Public Constructors
Public Member Operators
Public Member Functions
Synopsis
#include <rw/sortvec.h>
RWSortedVector a;
Description
Class RWSortedVector represents a group of ordered items, internally sorted by the compareTo()
function and accessible by an index number. Duplicates are allowed. An object stored by
RWSortedVector must inherit from the abstract base class RWCollectable. An insertion sort is
used to maintain the vector in sorted order.
Because class RWSortedVector is implemented as a vector of pointers, traversing the collection is
more efficient than with class RWBinaryTree. However, insertions are slower in the center of the
collection.
Note that because the vector is sorted, you must not modify elements contained in the vector in
such a way as to invalidate the ordering.