com.phoenixst.plexus

Class DefaultOrientedForest

public class DefaultOrientedForest extends DefaultGraph implements OrientedForest

A default implementation of the Graph and OrientedForest interfaces.

Since: 1.0

Version: $Revision: 1.21 $

Author: Ray A. Conner

Constructor Summary
DefaultOrientedForest()
Creates a new DefaultOrientedForest.
DefaultOrientedForest(Graph graph)
Creates a new DefaultOrientedForest which is a copy of the specified Graph.
Method Summary
Graph.EdgeaddEdge(Object object, Object tail, Object head, boolean isDirected)
TraverserchildTraverser(Object node)
protected Graph.EdgecreateEdge(Object object, Object tail, Object head, boolean isDirected, Object edgeState)
intgetDepth(Object node)
intgetHeight(Object node)
ObjectgetLeastCommonAncestor(Object aNode, Object bNode)
ObjectgetParent(Object node)
Graph.EdgegetParentEdge(Object node)
ObjectgetParentEndpoint(Graph.Edge edge)
ObjectgetRoot(Object node)
booleanisAncestor(Object ancestor, Object descendant)
booleanisForestEdge(Graph.Edge edge)
booleanisLeaf(Object node)
CollectionrootNodes()
Graph.EdgesetParent(Object object, Object tail, Object head, boolean isDirected, Object parent)
Adds a new forest Edge.

Constructor Detail

DefaultOrientedForest

public DefaultOrientedForest()
Creates a new DefaultOrientedForest.

DefaultOrientedForest

public DefaultOrientedForest(Graph graph)
Creates a new DefaultOrientedForest which is a copy of the specified Graph.

Method Detail

addEdge

public Graph.Edge addEdge(Object object, Object tail, Object head, boolean isDirected)

childTraverser

public Traverser childTraverser(Object node)

createEdge

protected Graph.Edge createEdge(Object object, Object tail, Object head, boolean isDirected, Object edgeState)

getDepth

public int getDepth(Object node)

getHeight

public int getHeight(Object node)

getLeastCommonAncestor

public Object getLeastCommonAncestor(Object aNode, Object bNode)

getParent

public Object getParent(Object node)

getParentEdge

public Graph.Edge getParentEdge(Object node)

getParentEndpoint

public Object getParentEndpoint(Graph.Edge edge)

getRoot

public Object getRoot(Object node)

isAncestor

public boolean isAncestor(Object ancestor, Object descendant)

isForestEdge

public boolean isForestEdge(Graph.Edge edge)

isLeaf

public boolean isLeaf(Object node)

rootNodes

public Collection rootNodes()

setParent

public Graph.Edge setParent(Object object, Object tail, Object head, boolean isDirected, Object parent)
Adds a new forest Edge. The specified parent must be one of the specified endpoints. If the child endpoint already has a parent edge, it will be removed.
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.