|
Plexus v0.13.1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.phoenixst.plexus.ForestTreeExtension
public class ForestTreeExtension
A RootedTree which is formed by extending an OrientedForest, adding a dummy root node (and edges) which is the
parent of the forest's root nodes.
| Constructor Summary | |
|---|---|
ForestTreeExtension(Object root,
OrientedForest forest)
Creates a new ForestTreeExtension. |
|
ForestTreeExtension(OrientedForest forest)
Creates a new ForestTreeExtension. |
|
| Method Summary | |
|---|---|
Traverser |
childTraverser(Object node)
Returns a Traverser over the children of the
specified node. |
int |
getDepth(Object node)
Gets the depth of the specified node. |
int |
getHeight(Object node)
Gets the height of the specified node. |
Object |
getLeastCommonAncestor(Object aNode,
Object bNode)
Returns the least common ancestor of the specified nodes, or null if none exists. |
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. |
Object |
getParentEndpoint(Graph.Edge edge)
Returns the parent endpoint of the specified forest Edge. |
Object |
getRoot()
Gets the root node. |
Object |
getRoot(Object node)
Gets the root of the subgraph containing the specified node. |
boolean |
isAncestor(Object ancestor,
Object descendant)
Returns true if ancestor is actually
an ancestor of descendant. |
boolean |
isForestEdge(Graph.Edge edge)
Gets whether or not the specified Edge is a
forest edge. |
boolean |
isLeaf(Object node)
Returns true if the specified node has no
children. |
boolean |
isTreeNode(Object node)
If the specified node is not the root node, this method delegates to OrientedForest.getParent(java.lang.Object) and returns
true if a NoSuchNodeException is not
thrown. |
Collection |
rootNodes()
Returns the root nodes of this forest. |
void |
setRoot(Object root)
Sets the root node, which must not be contained by the forest being extended, although this implementation does not check for that condition. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ForestTreeExtension(OrientedForest forest)
ForestTreeExtension.
public ForestTreeExtension(Object root,
OrientedForest forest)
ForestTreeExtension. The specified
forest should not contain the given root node.
| Method Detail |
|---|
public Object getRoot()
Rooted
getRoot in interface Rootedpublic void setRoot(Object root)
setRoot in interface Rootedpublic Object getParent(Object node)
OrientedForestnull if
it doesn't have one. If null is a valid node,
then OrientedForest.getParentEdge(java.lang.Object) must be used to distinguish the
two cases.
getParent in interface OrientedForestpublic Traverser childTraverser(Object node)
Traverser over the children of the
specified node. Traversers over the children of
the root node are unmodifiable.
childTraverser in interface OrientedForestpublic Graph.Edge getParentEdge(Object node)
OrientedForestEdge of the specified node, or
null if it doesn't have one.
getParentEdge in interface OrientedForestpublic boolean isForestEdge(Graph.Edge edge)
OrientedForestEdge is a
forest edge.
isForestEdge in interface OrientedForestpublic Object getParentEndpoint(Graph.Edge edge)
OrientedForestEdge. If the specified Edge is not
a forest edge, throws an
IllegalArgumentException.
getParentEndpoint in interface OrientedForestpublic Collection rootNodes()
OrientedForest
rootNodes in interface OrientedForestpublic Object getRoot(Object node)
OrientedForest
getRoot in interface OrientedForestpublic boolean isLeaf(Object node)
OrientedForesttrue if the specified node has no
children.
isLeaf in interface OrientedForest
public boolean isAncestor(Object ancestor,
Object descendant)
OrientedForesttrue if ancestor is actually
an ancestor of descendant.
isAncestor in interface OrientedForest
public Object getLeastCommonAncestor(Object aNode,
Object bNode)
OrientedForestnull if none exists. If null is a
valid node, then some other method must be used to distinguish
the two cases.
getLeastCommonAncestor in interface OrientedForestpublic int getDepth(Object node)
OrientedForest
getDepth in interface OrientedForestpublic int getHeight(Object node)
OrientedForest
getHeight in interface OrientedForestpublic boolean isTreeNode(Object node)
OrientedForest.getParent(java.lang.Object) and returns
true if a NoSuchNodeException is not
thrown. Otherwise, it returns false.
isTreeNode in interface RootedTree
|
Plexus v0.13.1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||