public class DefaultRootedTreeView extends DefaultOrientedForestView implements RootedTree
RootedTree
interface.Constructor and Description |
---|
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 . |
Modifier and Type | Method and Description |
---|---|
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 . |
childTraverser, getGraph, getParent, getParentEdge, isLeaf
getHeight, getLeastCommonAncestor, getParentEndpoint, isAncestor, isForestEdge
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
childTraverser, getHeight, getLeastCommonAncestor, getParent, getParentEdge, getParentEndpoint, isAncestor, isForestEdge, isLeaf
public DefaultRootedTreeView(Graph graph, org.apache.commons.collections.Predicate parentPredicate, org.apache.commons.collections.Predicate childPredicate)
DefaultRootedTreeView
.public boolean isTreeNode(Object node)
RootedTree
true
if the specified node is a
descendant of the root node.isTreeNode
in interface RootedTree
public void setRoot(Object root)
Graph
.public Collection rootNodes()
OrientedForest
rootNodes
in interface OrientedForest
rootNodes
in class DefaultOrientedForestView
public Object getRoot(Object node)
AbstractOrientedForest
getRoot
in interface OrientedForest
getRoot
in class AbstractOrientedForest
public int getDepth(Object node)
NoSuchNodeException
.getDepth
in interface OrientedForest
getDepth
in class AbstractOrientedForest
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.