Tools.h++ Manual
21-14 104011 Tandem Computers Incorporated
21
RWBinaryTree
RWBinaryTree
|
RWCollection
|
RWCollectable
Synopsis
typedef RWBinaryTree SortedCollection; // Smalltalk
typedef.
#include <rw/bintree.h>
RWBinaryTree bt;
Description Class
RWBinaryTree
represents a group of ordered elements, internally sorted
by the
compareTo()
function. Duplicates are allowed. An object stored by a
RWBinaryTree
must inherit abstract base class
RWCollectable
.
Public constructors
RWBinaryTree();
Construct an empty sorted collection.
RWBinaryTree(const RWBinaryTree& t);
Copy constructor. Constructs a shallow copy from
t
. Member function
balance()
(see below), is called before returning.
virtual ~RWBinaryTree();
Redeļ¬ned from
RWCollection
. Calls
clear()
.
Public member operators
void operator=(const RWBinaryTree&
bt);
Sets self to a shallow copy of
bt
.
RWBoolean operator<=(const RWBinaryTree&
bt) const;
Returns
TRUE
if self is a subset of the collection
bt
. That is, every item in self
must compare equal to an item in
bt
.
RWBoolean operator==(const RWBinaryTree&
bt) const;
Returns
TRUE
if self and
bt
are equivalent. That is, they must have the same
number of items and every item in self must compare equal to an item in
bt
.