Use these members to construct or destruct objects of the class.
![]() |
public:
~IATree()
Side Effects
All cursors of the tree become undefined.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
protected:
IATree(IATree < Element > const&)
Exception
IOutOfMemory
Windows | OS/2 | AIX |
Yes | Yes | Yes |
protected:
IATree()
Windows | OS/2 | AIX |
Yes | Yes | Yes |
Use these methods to add elements to or remove elements from the tree.
![]() |
public:
void addAsChild( ITreeCursor const&, IPosition, Element const& )
Preconditions
Exceptions
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
void addAsRoot(Element const&)
Precondition
The tree must not have a root; that is, it must be empty.
Exceptions
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
INumber removeAll()
Precondition
The cursor must point to an element of this tree.
Side Effects
For removeSubtree, the given cursor is invalidated after removal.
Exception
ICursorInvalidException
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
INumber removeSubtree(ITreeCursor&)
Precondition
The cursor must point to an element of this tree.
Side Effects
For removeSubtree(), the given cursor is invalidated after removal.
Exception
ICursorInvalidException
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
void replaceAt(ITreeCursor const&, Element const&)
Precondition
The cursor must point to an element of this tree.
Exception
ICursorInvalidException
Windows | OS/2 | AIX |
Yes | Yes | Yes |
Use these methods to test the status of the collection.
![]() |
public:
IBoolean isConsistent() const
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
IBoolean isEmpty() const
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
INumber numberOfElements() const
Preconditions
The cursor must belong to the tree and must point to an element in the tree.
Exception
ICursorInvalidException
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
INumber numberOfLeaves() const
Preconditions
The cursor must belong to the tree and must point to an element in the tree.
Exception
ICursorInvalidException
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
INumber numberOfSubtreeElements(ITreeCursor const&) const
Preconditions
The cursor must belong to the tree and must point to an element in the tree.
Exception
ICursorInvalidException
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
INumber numberOfSubtreeLeaves(ITreeCursor const&) const
Preconditions
The cursor must belong to the tree and must point to an element in the tree.
Exception
ICursorInvalidException
Windows | OS/2 | AIX |
Yes | Yes | Yes |
These methods point a cursor at a particular element in the collection.
![]() |
public:
ITreeCursor* newCursor() const
Return Value
Pointer to the cursor.
Exception
IOutOfMemory
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
IBoolean setToChild(IPosition, ITreeCursor&) const
Preconditions
Return Value
Returns true if the child exists.
Exceptions
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
IBoolean setToFirst( ITreeCursor&, ITreeIterationOrder ) const
Precondition
The cursor must belong to this tree.
Return Value
Returns true if the tree is not empty.
Exception
ICursorInvalidException
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
IBoolean setToFirstExistingChild(ITreeCursor&) const
Preconditions
The cursor must point to an element of this tree.
Return Value
Returns true if the node has a child.
Exception
ICursorInvalidException
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
IBoolean setToLast(ITreeCursor&, ITreeIterationOrder) const
Precondition
The cursor must belong to this tree.
Return Value
Returns true if the tree is not empty.
Exception
ICursorInvalidException
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
IBoolean setToLastExistingChild(ITreeCursor&) const
Sets the cursor to the last child of the node denoted by the given cursor (of this tree). Invalidates the cursor if the node has no child. A node with no child is a leaf node of the tree.
Precondition
The cursor must point to an element of this tree.
Return Value
Returns true if the node has a child.
Exception
ICursorInvalidException
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
IBoolean setToNext(ITreeCursor&, ITreeIterationOrder) const
Precondition
The cursor must point to an element of this tree.
Return Value
Returns true if the given cursor does not point to the last node (in iteration order).
Exception
ICursorInvalidException
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
IBoolean setToNextExistingChild(ITreeCursor&) const
Precondition
The cursor must point to an element of this tree.
Return Value
Returns true if the node has a next sibling.
Exception
ICursorInvalidException
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
IBoolean setToParent(ITreeCursor&) const
Precondition
The cursor must point to an element of this tree.
Return Value
Returns true if the node has a parent.
Exception
ICursorInvalidException
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
IBoolean setToPrevious( ITreeCursor&, ITreeIterationOrder ) const
Precondition
The cursor must point to an element of this tree.
Return Value
Returns true if the given cursor does not point to the first node (in iteration order).
Exception
ICursorInvalidException
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
IBoolean setToPreviousExistingChild(ITreeCursor&) const
Precondition
The cursor must point to an element of this tree.
Return Value
Returns true if the node has a previous sibling.
Exception
ICursorInvalidException
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
IBoolean setToRoot(ITreeCursor&) const
Precondition
The cursor must belong to this tree.
Return Value
Returns true if the tree is not empty.
Exception
ICursorInvalidException
Windows | OS/2 | AIX |
Yes | Yes | Yes |
These methods apply actions to all the elements of the tree collection or any subtree of the collection.
![]() |
public:
IBoolean allElementsDo( IApplicator < Element >&, ITreeIterationOrder )
Calls the applyTo() function of the given applicator for all elements of the
subtree denoted by the given cursor (of this tree) until the apply To()
function returns false.
The elements are visited in iteration order.
The allElementsDo() function returns (without a subtree cursor argument)
iterates over all elements of the tree.
Preconditions
Return Value
Returns true if the applyTo() function returns true
for every element it is applied to.
Exceptions
Note:
Windows | OS/2 | AIX |
Yes | Yes | Yes |
public:
IBoolean allElementsDo( IBoolean ( * applicatorFunction ) ( Element const&, void * ), ITreeIterationOrder , void* additionalArgument = 0 ) const
Calls the given function for all elements of the subtree denoted
by the given cursor (of this tree)
until the given function returns false.
The elements are visited in the given iteration order.
Additional arguments can be passed to the given function using
additionalArgument.
The additional argument defaults to zero
if no additional argument is given.
The allElementsDo() function (without a subtree
cursor argument) iterates over all elements of the tree.
Return Value
Returns true if the given function returns true
for every element it is applied to.
Preconditions
Exception
ICursorInvalidException
Note:
Windows | OS/2 | AIX |
Yes | Yes | Yes |
public:
IBoolean allElementsDo( IConstantApplicator < Element >&, ITreeIterationOrder ) const
Calls the applyTo() function of the given applicator for all elements of the
subtree denoted by the given cursor (of this tree) until the apply To()
function returns false.
The elements are visited in iteration order.
The allElementsDo() function returns (without a subtree cursor argument)
iterates over all elements of the tree.
Preconditions
Return Value
Returns true if the applyTo() function returns true
for every element it is applied to.
Exceptions
Note:
Windows | OS/2 | AIX |
Yes | Yes | Yes |
public:
IBoolean allElementsDo( IBoolean ( * applicatorFunction ) ( Element&, void * ), ITreeIterationOrder , void* additionalArgument = 0 )
Calls the given function for all elements of the subtree denoted
by the given cursor (of this tree)
until the given function returns false.
The elements are visited in the given iteration order.
Additional arguments can be passed to the given function using
additionalArgument.
The additional argument defaults to zero
if no additional argument is given.
The allElementsDo() function (without a subtree
cursor argument) iterates over all elements of the tree.
Return Value
Returns true if the given function returns true
for every element it is applied to.
Preconditions
Exception
ICursorInvalidException
Note:
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
IBoolean allSubtreeElementsDo( ITreeCursor const&, IConstantApplicator < Element >&, ITreeIterationOrder ) const
Calls the applyTo() function of the given applicator for all elements of the
subtree denoted by the given cursor (of this tree) until the apply To()
function returns false.
The elements are visited in iteration order.
The allElementsDo() function returns (without a subtree cursor argument)
iterates over all elements of the tree.
Preconditions
Return Value
Returns true if the applyTo() function returns true
for every element it is applied to.
Exceptions
Note:
Windows | OS/2 | AIX |
Yes | Yes | Yes |
public:
IBoolean allSubtreeElementsDo( ITreeCursor const&, IBoolean ( * applicatorFunction ) ( Element&, void * ), ITreeIterationOrder , void* additionalArgument = 0 )
Calls the given function for all elements of the subtree denoted
by the given cursor (of this tree)
until the given function returns false.
The elements are visited in the given iteration order.
Additional arguments can be passed to the given function using
additionalArgument.
The additional argument defaults to zero
if no additional argument is given.
The allElementsDo() function (without a subtree
cursor argument) iterates over all elements of the tree.
Return Value
Returns true if the given function returns true
for every element it is applied to.
Preconditions
Exception
ICursorInvalidException
Note:
Windows | OS/2 | AIX |
Yes | Yes | Yes |
public:
IBoolean allSubtreeElementsDo( ITreeCursor const&, IBoolean ( * applicatorFunction ) ( Element const&, void * ), ITreeIterationOrder , void* additionalArgument = 0 ) const
Calls the given function for all elements of the subtree denoted
by the given cursor (of this tree)
until the given function returns false.
The elements are visited in the given iteration order.
Additional arguments can be passed to the given function using
additionalArgument.
The additional argument defaults to zero
if no additional argument is given.
The allElementsDo() function (without a subtree
cursor argument) iterates over all elements of the tree.
Return Value
Returns true if the given function returns true
for every element it is applied to.
Preconditions
Exception
ICursorInvalidException
Note:
Windows | OS/2 | AIX |
Yes | Yes | Yes |
public:
IBoolean allSubtreeElementsDo( ITreeCursor const&, IApplicator < Element >&, ITreeIterationOrder )
Calls the applyTo() function of the given applicator for all elements of the
subtree denoted by the given cursor (of this tree) until the apply To()
function returns false.
The elements are visited in iteration order.
The allElementsDo() function returns (without a subtree cursor argument)
iterates over all elements of the tree.
Preconditions
Return Value
Returns true if the applyTo() function returns true
for every element it is applied to.
Exceptions
Note:
Windows | OS/2 | AIX |
Yes | Yes | Yes |
Use these methods to access the elements of the collection.
![]() |
Precondition
The cursor must point to an element of this tree.
Exception
ICursorInvalidException
public:
Element const& elementAt(ITreeCursor const&) const
Windows | OS/2 | AIX |
Yes | Yes | Yes |
public:
Element& elementAt(ITreeCursor const&)
Windows | OS/2 | AIX |
Yes | Yes | Yes |
Use these methods to test elements to see if they are leaf or root nodes.
![]() |
public:
IPosition childPositionAt(ITreeCursor const&) const
Returns the position of the node pointed to by the given cursor as a child with respect to its parent node. The position of the root node is 1.
Precondition
The cursor must point to an element of this tree.
Exception
ICursorInvalidException
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
IBoolean isLeaf(ITreeCursor const&) const
Precondition
The cursor must point to an element of this tree.
Exception
ICursorInvalidException
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
IBoolean isRoot(ITreeCursor const&) const
Precondition
The cursor must point to an element of this tree.
Exception
ICursorInvalidException
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
IPosition position(ITreeCursor const&) const
Precondition
The cursor must point to an element of this tree.
Exception
ICursorInvalidException
Windows | OS/2 | AIX |
Yes | Yes | Yes |
These methods support streaming of elements to and from data streams.
![]() |
public:
void adoptStreamer(IACollectionStreamer*)
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
void operator <<=(IDataStream&)
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
void operator >>=(IDataStream&)
Windows | OS/2 | AIX |
Yes | Yes | Yes |
~IATreeBase()
static ITreeCursorImpl& CrsrImplOf(ITreeCursor& cursor)
static ITreeCursorImpl const& CrsrImplOf( ITreeCursor const& cursor )
IATreeBase()
IATreeBase(IATreeBase const&)
static ITreeCursor* InterfaceFor(ITreeCursorImpl* cursor)
static Implementation& ImplOf(IATree < Element > const&)