com.phoenixst.plexus
public interface OrientedForest
X is the parent of node Y,
then we also say that Y is a "child" of
X. A node may have multiple children.
X is reachable through successive
applications of the parent operation from node
Y, then X is an "ancestor" of
Y, and Y is a "descendant" of
X. Note that any node is both an ancestor and
descendant of itself.
0.
0.
The word "oriented" was chosen instead of the more commonly used "directed" because the directedness of the edges need not have any bearing on the parent-child relationships.
Since: 1.0
Version: $Revision: 1.2 $
| Method Summary | |
|---|---|
| Traverser | childTraverser(Object node)
Traverses over the children of the specified node. |
| int | getDepth(Object node)
Gets the depth of the specified node. |
| int | getHeight(Object node)
Gets the height of the specified node. |
| Object | getLeastCommonAncestor(Object aNode, Object bNode)
Returns the least common ancestor of the specified nodes, or
null if none exists. |
| Object | getParent(Object node)
Gets the parent of the specified node, or null if
it doesn't have one. |
| Graph.Edge | getParentEdge(Object node)
Gets the parent Edge of the specified node, or
null if it doesn't have one. |
| Object | getParentEndpoint(Graph.Edge edge)
Returns the parent endpoint of the specified forest
Edge. |
| Object | getRoot(Object node)
Gets the root of the subgraph containing the specified node. |
| boolean | isAncestor(Object ancestor, Object descendant)
Returns true if ancestor is actually
an ancestor of descendant. |
| boolean | isForestEdge(Graph.Edge edge)
Gets whether or not the specified Edge is a
forest edge. |
| boolean | isLeaf(Object node)
Returns true if the specified node has no
children. |
| Collection | rootNodes()
Returns the root nodes of this forest. |
null if none exists. If null is a
valid node, then some other method must be used to distinguish
the two cases.null if
it doesn't have one. If null is a valid node,
then OrientedForest must be used to distinguish the
two cases.Edge of the specified node, or
null if it doesn't have one.Edge. If the specified Edge is not
a forest edge, throws an
IllegalArgumentException.true if ancestor is actually
an ancestor of descendant.Edge is a
forest edge.true if the specified node has no
children.