Plexus v0.13.1

com.phoenixst.plexus
Class DefaultRootedTreeView

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

public class DefaultRootedTreeView
extends DefaultOrientedForestView
implements RootedTree

A default view implementation of the RootedTree interface.

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

Constructor Summary
DefaultRootedTreeView(Graph graph, Object root, org.apache.commons.collections.Predicate parentPredicate, org.apache.commons.collections.Predicate childPredicate)
          Creates a new DefaultRootedTreeView.
DefaultRootedTreeView(Graph graph, org.apache.commons.collections.Predicate parentPredicate, org.apache.commons.collections.Predicate childPredicate)
          Creates a new DefaultRootedTreeView.
 
Method Summary
 int getDepth(Object node)
          Gets the depth of the specified node.
 Object getRoot()
          Gets the root node.
 Object getRoot(Object node)
          Gets the root of the subgraph containing the specified node.
 boolean isTreeNode(Object node)
          Returns true if the specified node is a descendant of the root node.
 Collection rootNodes()
          Returns the root nodes of this forest.
 void setRoot(Object root)
          Sets the root node, which must already be present in the Graph.
 
Methods inherited from class com.phoenixst.plexus.DefaultOrientedForestView
childTraverser, getGraph, getParent, getParentEdge, isLeaf
 
Methods inherited from class com.phoenixst.plexus.AbstractOrientedForest
getHeight, getLeastCommonAncestor, getParentEndpoint, isAncestor, isForestEdge
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.phoenixst.plexus.OrientedForest
childTraverser, getHeight, getLeastCommonAncestor, getParent, getParentEdge, getParentEndpoint, isAncestor, isForestEdge, isLeaf
 

Constructor Detail

DefaultRootedTreeView

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


DefaultRootedTreeView

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

Method Detail

isTreeNode

public boolean isTreeNode(Object node)
Description copied from interface: RootedTree
Returns true if the specified node is a descendant of the root node.

Specified by:
isTreeNode in interface RootedTree

getRoot

public Object getRoot()
Gets the root node.

Specified by:
getRoot in interface Rooted

setRoot

public void setRoot(Object root)
Sets the root node, which must already be present in the Graph.

Specified by:
setRoot in interface Rooted

rootNodes

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

Specified by:
rootNodes in interface OrientedForest
Overrides:
rootNodes in class DefaultOrientedForestView

getRoot

public Object getRoot(Object node)
Description copied from class: AbstractOrientedForest
Gets the root of the subgraph containing the specified node.

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

getDepth

public int getDepth(Object node)
Gets the depth of the specified node. If the specified node is not a descendant of the root node, this method will throw a NoSuchNodeException.

Specified by:
getDepth in interface OrientedForest
Overrides:
getDepth 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.