public abstract class AbstractOrientedForest extends Object implements OrientedForest
OrientedForest interface, to minimize the effort
required to implement this interface.
All concrete extensions of this class must implement the following methods:
The documentation for each non-abstract method in this class describes its implementation in detail. Each of these methods may be overridden if there is a more efficient implementation.
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractOrientedForest()
Creates a new
AbstractOrientedForest. |
| Modifier and Type | Method and Description |
|---|---|
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. |
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. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitchildTraverser, getParentEdge, rootNodesprotected AbstractOrientedForest()
AbstractOrientedForest.public Object getParent(Object node)
null if
it doesn't have one. If the graph may contain a
null node, then getParentEdge( node ) must be used to distinguish the two cases.getParent in interface OrientedForestpublic boolean isForestEdge(Graph.Edge edge)
isForestEdge in interface OrientedForestpublic Object getParentEndpoint(Graph.Edge edge)
IllegalArgumentException.getParentEndpoint in interface OrientedForestpublic Object getRoot(Object node)
getRoot in interface OrientedForestpublic boolean isLeaf(Object node)
true if the specified node has no
children.isLeaf in interface OrientedForestpublic boolean isAncestor(Object ancestor, Object descendant)
true if ancestor is actually
an ancestor of descendant.isAncestor in interface OrientedForestpublic Object getLeastCommonAncestor(Object aNode, Object bNode)
null if none exists. If the graph may contain a
null node, then some other method must be used to
distinguish the two cases.getLeastCommonAncestor in interface OrientedForestpublic int getDepth(Object node)
getDepth in interface OrientedForestpublic int getHeight(Object node)
getHeight in interface OrientedForestSee the Plexus project home, hosted by SourceForge.
Copyright ? 1994-2006, by Phoenix Software Technologists, Inc. and others. All Rights Reserved. Use is subject to license terms.