com.phoenixst.plexus

Class DefaultRootedTreeView

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

Constructor Summary
DefaultRootedTreeView(Graph graph, Predicate parentPredicate, Predicate childPredicate)
Creates a new DefaultRootedTreeView.
DefaultRootedTreeView(Graph graph, Object root, Predicate parentPredicate, Predicate childPredicate)
Creates a new DefaultRootedTreeView.
Method Summary
intgetDepth(Object node)
Gets the depth of the specified node.
ObjectgetRoot()
Gets the root node.
ObjectgetRoot(Object node)
booleanisTreeNode(Object node)
CollectionrootNodes()
voidsetRoot(Object root)
Sets the root node, which must already be present in the Graph.

Constructor Detail

DefaultRootedTreeView

public DefaultRootedTreeView(Graph graph, Predicate parentPredicate, Predicate childPredicate)
Creates a new DefaultRootedTreeView.

DefaultRootedTreeView

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

Method Detail

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.

getRoot

public Object getRoot()
Gets the root node.

getRoot

public Object getRoot(Object node)

isTreeNode

public boolean isTreeNode(Object node)

rootNodes

public Collection rootNodes()

setRoot

public void setRoot(Object root)
Sets the root node, which must already be present in the Graph.
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.