com.phoenixst.plexus
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.
Since: 1.0
Version: $Revision: 1.12 $
Constructor Summary | |
---|---|
protected | AbstractOrientedForest()
Creates a new AbstractOrientedForest . |
Method Summary | |
---|---|
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. |
AbstractOrientedForest
.null
if none exists. If the graph may contain a
null
node, then some other method must be used to
distinguish the two cases.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.IllegalArgumentException
.true
if ancestor
is actually
an ancestor of descendant
.true
if the specified node has no
children.