com.phoenixst.plexus.algorithms

Class DepthFirstForestView

public class DepthFirstForestView extends AbstractDepthFirstForestView

A constructive (not lazy) depth-first tree for a portion of a Graph.

This implementation tracks discovery time and finishing time, and can possibly answer a few structural questions about the underlying Graph. Whether or not these questions can be answered depends upon whether the supplied Traverser predicate or factory is direction agnostic. If at least one encountered edge can be traversed in only one direction, then many structural queries cannot be answered by this class, and will throw exceptions. The only exception is in the case of self-loops; these may only be traversed in one direction with no ill effect. These cases are documented in the appropriate methods.

If the underlying Graph changes, this view may become invalid, but perhaps not detectably so.

Since: 1.0

Version: $Revision: 1.15 $

Author: Ray A. Conner

Constructor Summary
DepthFirstForestView(Graph graph, Predicate traverserPredicate)
Creates a new DepthFirstForestView.
DepthFirstForestView(Graph graph, Transformer traverserFactory)
Creates a new DepthFirstForestView.
Method Summary
CollectionrootNodes()
Returns a list of the root nodes for this depth-first traversal in the order encountered.

Constructor Detail

DepthFirstForestView

public DepthFirstForestView(Graph graph, Predicate traverserPredicate)
Creates a new DepthFirstForestView.

DepthFirstForestView

public DepthFirstForestView(Graph graph, Transformer traverserFactory)
Creates a new DepthFirstForestView.

Method Detail

rootNodes

public Collection rootNodes()
Returns a list of the root nodes for this depth-first traversal in the order encountered.

Description copied from interface: OrientedForest
{@inheritDoc }

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.