|
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.AbstractOrientedForest
public abstract class AbstractOrientedForest
This class provides a skeletal implementation of the
OrientedForest
interface, to minimize the effort
required to implement this interface.
All concrete extensions of this class must implement the following methods:
The documentation for each non-abstract method in this class describes its implementation in detail. Each of these methods may be overridden if there is a more efficient implementation.
Constructor Summary | |
---|---|
protected |
AbstractOrientedForest()
Creates a new AbstractOrientedForest . |
Method Summary | |
---|---|
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. |
Object |
getParentEndpoint(Graph.Edge edge)
Returns the parent endpoint of the specified forest edge. |
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. |
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, getParentEdge, rootNodes |
Constructor Detail |
---|
protected AbstractOrientedForest()
AbstractOrientedForest
.
Method Detail |
---|
public Object getParent(Object node)
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.
getParent
in interface OrientedForest
public boolean isForestEdge(Graph.Edge edge)
isForestEdge
in interface OrientedForest
public Object getParentEndpoint(Graph.Edge edge)
IllegalArgumentException
.
getParentEndpoint
in interface OrientedForest
public Object getRoot(Object node)
getRoot
in interface OrientedForest
public boolean isLeaf(Object node)
true
if the specified node has no
children.
isLeaf
in interface OrientedForest
public boolean isAncestor(Object ancestor, Object descendant)
true
if ancestor
is actually
an ancestor of descendant
.
isAncestor
in interface OrientedForest
public Object getLeastCommonAncestor(Object aNode, Object bNode)
null
if none exists. If the graph may contain a
null
node, then some other method must be used to
distinguish the two cases.
getLeastCommonAncestor
in interface OrientedForest
public int getDepth(Object node)
getDepth
in interface OrientedForest
public int getHeight(Object node)
getHeight
in interface OrientedForest
|
Plexus v0.13.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |