Home | Trees | Indices | Help |
|
---|
|
object --+ | list --+ | Tree --+ | AbstractParentedTree --+ | MultiParentedTree
A Tree that automatically maintains parent pointers for multi-parented trees. The following read-only property values are automatically updated whenever the structure of a multi-parented tree is modified: parents, parent_indices, left_siblings, right_siblings, roots, treepositions.
Each MultiParentedTree
may have zero or more parents. In
particular, subtrees may be shared. If a single
MultiParentedTree
is used as multiple children of the same
parent, then that parent will appear multiple times in its
parents
property.
MultiParentedTrees
should never be used in the same tree
as Trees
or ParentedTrees
. Mixing tree
implementations may result in incorrect parent pointers and in
TypeError
exceptions.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from Inherited from Inherited from Inherited from |
|
|||
Inherited from Inherited from |
|
|||
|
|||
_parents A list of this tree's parents. |
|
|||
list of MultiParentedTree
|
parents The set of parents of this tree. |
||
list of MultiParentedTree
|
left_siblings A list of all left siblings of this tree, in any of its parent trees. |
||
list of MultiParentedTree
|
right_siblings A list of all right siblings of this tree, in any of its parent trees. |
||
list of MultiParentedTree
|
roots The set of all roots of this tree. |
||
Inherited from |
|
Construct a new tree. This constructor can be called in one of two ways:
|
|
Return a list of the indices where this tree occurs as a child of
for parent_index in ptree.parent_indices(parent): parent[parent_index] is ptree |
Return a list of all tree positions that can be used to reach this
multi-parented tree starting from for treepos in ptree.treepositions(root): root[treepos] is ptree
|
Update
|
Update
|
|
_parentsA list of this tree's parents. This list should not contain duplicates, even if a parent contains this tree multiple times. |
|
parentsThe set of parents of this tree. If this tree has no parents, then
|
left_siblingsA list of all left siblings of this tree, in any of its parent trees. A tree may be its own left sibling if it is used as multiple contiguous children of the same parent. A tree may appear multiple times in this list if it is the left sibling of this tree with respect to multiple parents.
|
right_siblingsA list of all right siblings of this tree, in any of its parent trees. A tree may be its own right sibling if it is used as multiple contiguous children of the same parent. A tree may appear multiple times in this list if it is the right sibling of this tree with respect to multiple parents.
|
rootsThe set of all roots of this tree. This set is formed by tracing all possible parent paths until trees with no parents are found.
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0beta1 on Wed Aug 27 15:08:58 2008 | http://epydoc.sourceforge.net |