Package groupthink :: Module aatree :: Class Node
[hide private]
[frames] | no frames]

Class Node

source code

Known Subclasses:

Node represents a node in a binary tree. It is entirely passive, acting as a container much a like a C struct. Its unusual features include a distinction between annotation and value, and references not only to its children but also to its parent.

Instance Variables [hide private]
Node parent = None
The parent of the node, or None if the node has no parent
Node leftchild = None
The left child of the node, or None if the node has no left child
Node rightchild = None
The right child of the node, or None if the node has no right child
tree-specific type annotation = None
A piece of data associated with a node, assigned by a tree-specific function and satisfying a related constraint.
typically unconstrained value = None
A value assigned by the user of the tree.
Instance Variable Details [hide private]

value

A value assigned by the user of the tree. In monoid-annotated trees, only the leaves typically have values, and internal nodes will therefore have a value of None. The purpose of the annotation is to permit the construction of monoid-annotated trees, which often have both highly constrained annotations and completely unconstrained values. See, for example, http://scienceblogs.com/goodmath/2009/05/finally_finger_trees.php. Non-monoid-annotated trees may ignore this variable.
Type:
typically unconstrained
Value:
None