SimpleTree documentation

Authors

Generated by rh

Contents -

  1. Software documentation for the SimpleTree class
  2. Software documentation for the TreeEnumerator class

Software documentation for the SimpleTree class

SimpleTree : NSObject

Declared in:
SimpleTree.h
A simple, abstract tree class

Instance Variables

Method summary

count 

- (unsigned) count;
count the number of nodes in the tree

dealloc 

- (void) dealloc;
releases all nodes held by the tree, then deallocate tree memor

objectEnumerator 

- (NSEnumerator*) objectEnumerator;
returns the default enumerator of the tree.

releaseTreeNodes 

- (id) releaseTreeNodes;
releases all nodes within the tree.

root 

- (id) root;
returns the root node of the tree.

setRoot: 

- (id) setRoot: (id)newRoot;
Replace the whole tree with a new root node



Instance Variables for SimpleTree Class

root

@protected id root;
the root node of the tree




Software documentation for the TreeEnumerator class

TreeEnumerator : NSEnumerator

Declared in:
SimpleTree.h
An object enumerator for the SimpleTree class This is an abstract class, subclasses will need to implement actual enumerators.

Instance Variables

Method summary

advance 

- (id) advance;
advance to the next object within the tree. This method is a stub that needs to be overridden by a concrete sub class

autoreleaseNode 

- (void) autoreleaseNode;
release the currently held node to the Autorelease Pool

dealloc 

- (void) dealloc;
release the current tree reference held by the enumerator and deallocate the TreeEnumerator

initWithTree: 

- (id) initWithTree: (SimpleTree*)newTree;
Initialises the enumerator with a given tree.

nextObject 

- (id) nextObject;
returns the next, enumerated object

setFirstChild: 

- (id) setFirstChild: (id)object;
set the first child for the enumerator This method is a stub that needs to be overridden by a concrete sub class

setLastChild: 

- (id) setLastChild: (id)object;
set the last child for the enumerator This method is a stub that needs to be overridden by a concrete sub class

setTree: 

- (id) setTree: (SimpleTree*)newTree;
replaces the tree held by the enumerator with a new tree



Instance Variables for TreeEnumerator Class

currentNode

@protected id currentNode;
the current node

nextNode

@protected id nextNode;
the next node

tree

@protected SimpleTree* tree;
the tree to enumerate