|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.phoenixst.plexus.AbstractOrientedForest
org.progeeks.graph.StandardOrientedForestView
public class StandardOrientedForestView
A default implementation of the OrientedForestView interface that supports some different operations than the standard Plexus DefaultOrientedForestView at the expense of a little correctness. First, we allow a filter to be specified for finding the root nodes which potentially eliminates having to do a whole graph search if the graph implementation is optimized for the filter. This may lead to inconsistent results since traversing up to a random node's root may return a root that is not in the returned root collection. This class will primarily be used for top down graph exploration though so this is likely never to happen and could be checked for in any case. Also, this version allows the filters to be changed at runtime.
Constructor Summary | |
---|---|
StandardOrientedForestView()
Creates an empty oriented forest view. |
|
StandardOrientedForestView(com.phoenixst.plexus.Graph view)
Creates a flat oriented forest view of the specified graph. |
|
StandardOrientedForestView(com.phoenixst.plexus.Graph view,
org.apache.commons.collections.Predicate rootPredicate,
org.apache.commons.collections.Predicate parentPredicate,
org.apache.commons.collections.Predicate childPredicate)
Creates an oriented forest view with the specified properties. |
Method Summary | |
---|---|
com.phoenixst.plexus.Traverser |
childTraverser(java.lang.Object node)
|
org.apache.commons.collections.Predicate |
getChildPredicate()
|
com.phoenixst.plexus.Graph |
getGraph()
|
java.lang.Object |
getParent(java.lang.Object node)
|
com.phoenixst.plexus.Graph.Edge |
getParentEdge(java.lang.Object node)
|
org.apache.commons.collections.Predicate |
getParentPredicate()
|
org.apache.commons.collections.Predicate |
getRootPredicate()
|
boolean |
isLeaf(java.lang.Object node)
|
java.util.Collection |
rootNodes()
|
void |
setChildPredicate(org.apache.commons.collections.Predicate childPredicate)
Sets the predicate used to find the children of nodes. |
void |
setGraph(com.phoenixst.plexus.Graph graph)
Sets the graph for which this view is a view. |
void |
setParentPredicate(org.apache.commons.collections.Predicate parentPredicate)
Sets the predicate used to find the parents of nodes. |
void |
setRootPredicate(org.apache.commons.collections.Predicate rootPredicate)
Sets the predicate used to locate the initial root set. |
Methods inherited from class com.phoenixst.plexus.AbstractOrientedForest |
---|
getDepth, getHeight, getLeastCommonAncestor, getParentEndpoint, getRoot, isAncestor, isForestEdge |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StandardOrientedForestView()
public StandardOrientedForestView(com.phoenixst.plexus.Graph view)
public StandardOrientedForestView(com.phoenixst.plexus.Graph view, org.apache.commons.collections.Predicate rootPredicate, org.apache.commons.collections.Predicate parentPredicate, org.apache.commons.collections.Predicate childPredicate)
Method Detail |
---|
public void setGraph(com.phoenixst.plexus.Graph graph)
public com.phoenixst.plexus.Graph getGraph()
getGraph
in interface com.phoenixst.plexus.GraphView
public void setRootPredicate(org.apache.commons.collections.Predicate rootPredicate)
public org.apache.commons.collections.Predicate getRootPredicate()
public void setParentPredicate(org.apache.commons.collections.Predicate parentPredicate)
public org.apache.commons.collections.Predicate getParentPredicate()
public void setChildPredicate(org.apache.commons.collections.Predicate childPredicate)
public org.apache.commons.collections.Predicate getChildPredicate()
public java.lang.Object getParent(java.lang.Object node)
getParent
in interface com.phoenixst.plexus.OrientedForest
getParent
in class com.phoenixst.plexus.AbstractOrientedForest
public com.phoenixst.plexus.Graph.Edge getParentEdge(java.lang.Object node)
getParentEdge
in interface com.phoenixst.plexus.OrientedForest
public com.phoenixst.plexus.Traverser childTraverser(java.lang.Object node)
childTraverser
in interface com.phoenixst.plexus.OrientedForest
public java.util.Collection rootNodes()
rootNodes
in interface com.phoenixst.plexus.OrientedForest
public boolean isLeaf(java.lang.Object node)
isLeaf
in interface com.phoenixst.plexus.OrientedForest
isLeaf
in class com.phoenixst.plexus.AbstractOrientedForest
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |