com.phoenixst.plexus

Class AbstractOrientedForest

public abstract class AbstractOrientedForest extends Object implements OrientedForest

This class provides a skeletal implementation of the 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 $

Author: Ray A. Conner

Constructor Summary
protected AbstractOrientedForest()
Creates a new AbstractOrientedForest.
Method Summary
intgetDepth(Object node)
Gets the depth of the specified node.
intgetHeight(Object node)
Gets the height of the specified node.
ObjectgetLeastCommonAncestor(Object aNode, Object bNode)
Returns the least common ancestor of the specified nodes, or null if none exists.
ObjectgetParent(Object node)
Gets the parent of the specified node, or null if it doesn't have one.
ObjectgetParentEndpoint(Graph.Edge edge)
Returns the parent endpoint of the specified forest edge.
ObjectgetRoot(Object node)
Gets the root of the subgraph containing the specified node.
booleanisAncestor(Object ancestor, Object descendant)
Returns true if ancestor is actually an ancestor of descendant.
booleanisForestEdge(Graph.Edge edge)
Gets whether or not the specified edge is a forest edge.
booleanisLeaf(Object node)
Returns true if the specified node has no children.

Constructor Detail

AbstractOrientedForest

protected AbstractOrientedForest()
Creates a new AbstractOrientedForest.

Method Detail

getDepth

public int getDepth(Object node)
Gets the depth of the specified node.

getHeight

public int getHeight(Object node)
Gets the height of the specified node.

getLeastCommonAncestor

public Object getLeastCommonAncestor(Object aNode, Object bNode)
Returns the least common ancestor of the specified nodes, or null if none exists. If the graph may contain a null node, then some other method must be used to distinguish the two cases.

getParent

public Object getParent(Object node)
Gets the parent of the specified node, or 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.

getParentEndpoint

public Object getParentEndpoint(Graph.Edge edge)
Returns the parent endpoint of the specified forest edge. If the specified edge is not a forest edge, throws an IllegalArgumentException.

getRoot

public Object getRoot(Object node)
Gets the root of the subgraph containing the specified node.

isAncestor

public boolean isAncestor(Object ancestor, Object descendant)
Returns true if ancestor is actually an ancestor of descendant.

isForestEdge

public boolean isForestEdge(Graph.Edge edge)
Gets whether or not the specified edge is a forest edge.

isLeaf

public boolean isLeaf(Object node)
Returns true if the specified node has no children.
See the Plexus project home, hosted by SourceForge.
Copyright B) 1994-2006, by Phoenix Software Technologists, Inc. and others. All Rights Reserved. Use is subject to license terms.