Plexus v0.13.1

com.phoenixst.plexus
Class DefaultOrientedForestView

java.lang.Object
  extended by com.phoenixst.plexus.AbstractOrientedForest
      extended by com.phoenixst.plexus.DefaultOrientedForestView
All Implemented Interfaces:
GraphView, OrientedForest, Serializable
Direct Known Subclasses:
DefaultRootedTreeView

public class DefaultOrientedForestView
extends AbstractOrientedForest
implements GraphView, Serializable

A default view implementation of the OrientedForest interface.

Since:
1.0
Version:
$Revision: 1.16 $
Author:
Ray A. Conner
See Also:
Serialized Form

Constructor Summary
DefaultOrientedForestView(Graph graph, org.apache.commons.collections.Predicate parentPredicate, org.apache.commons.collections.Predicate childPredicate)
          Creates a new DefaultOrientedForestView.
 
Method Summary
 Traverser childTraverser(Object node)
          Traverses over the children of the specified node.
 Graph getGraph()
          Returns the Graph of which this is a view.
 Object getParent(Object node)
          Gets the parent of the specified node, or null if it doesn't have one.
 Graph.Edge getParentEdge(Object node)
          Gets the parent Edge of the specified node, or null if it doesn't have one.
 boolean isLeaf(Object node)
          Returns true if the specified node has no children.
 Collection rootNodes()
          Returns the root nodes of this forest.
 
Methods inherited from class com.phoenixst.plexus.AbstractOrientedForest
getDepth, getHeight, getLeastCommonAncestor, getParentEndpoint, getRoot, isAncestor, isForestEdge
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultOrientedForestView

public DefaultOrientedForestView(Graph graph,
                                 org.apache.commons.collections.Predicate parentPredicate,
                                 org.apache.commons.collections.Predicate childPredicate)
Creates a new DefaultOrientedForestView.

Method Detail

getGraph

public Graph getGraph()
Description copied from interface: GraphView
Returns the Graph of which this is a view.

Specified by:
getGraph in interface GraphView

getParent

public Object getParent(Object node)
Description copied from class: AbstractOrientedForest
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.

Specified by:
getParent in interface OrientedForest
Overrides:
getParent in class AbstractOrientedForest

getParentEdge

public Graph.Edge getParentEdge(Object node)
Description copied from interface: OrientedForest
Gets the parent Edge of the specified node, or null if it doesn't have one.

Specified by:
getParentEdge in interface OrientedForest

childTraverser

public Traverser childTraverser(Object node)
Description copied from interface: OrientedForest
Traverses over the children of the specified node.

Specified by:
childTraverser in interface OrientedForest

rootNodes

public Collection rootNodes()
Description copied from interface: OrientedForest
Returns the root nodes of this forest.

Specified by:
rootNodes in interface OrientedForest

isLeaf

public boolean isLeaf(Object node)
Description copied from class: AbstractOrientedForest
Returns true if the specified node has no children.

Specified by:
isLeaf in interface OrientedForest
Overrides:
isLeaf in class AbstractOrientedForest

Plexus v0.13.1

See 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.