|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ca.quine.jcommons.transform.graph.SearchUtils
Field Summary | |
static int |
TRAVERSAL_BFS
Use a breadth first search traversal. |
static int |
TRAVERSAL_DFS_POSTORDER
Use a depth first search traversal, where we visit each node after its children. |
static int |
TRAVERSAL_DFS_PRE_AND_POSTORDER
Use a depth first search traversal, where each node is applied before and after its children. |
static int |
TRAVERSAL_DFS_PREORDER
Use a depth first search traversal, where we visit each node before its children. |
Method Summary | |
static void |
apply(TransformNode parentNode,
int traversal,
INodeApplicator applicator)
Applies the given applicator to the given
TransformNode and it's children in the given
traversal order. |
static void |
apply(TransformNode parentNode,
TransformNode node,
int traversal,
INodeApplicator applicator)
Applies the given applicator to the given
TransformNode in the given traversal order. |
static boolean |
applyDFS(TransformNode inGPNode,
TransformNode inParentNode,
IDFSNodeApplicator applicator)
Perform a DFS with a Stack instead of recursion to get around Java's problem of having a much smaller stack size than heap space. |
static boolean |
applyDFSMarkedEdges(TransformNode inGPNode,
TransformNode inParentNode,
IDFSNodeApplicator applicator)
Similar to applyDFS(TransformNode, TransformNode, IDFSNodeApplicator)
but only traverses marked edges. |
static boolean |
applyDFSRecursive(TransformNode grandParentNode,
TransformNode parentNode,
IDFSNodeApplicator applicator)
Sample code for perfectly ordinary recursive DFS. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int TRAVERSAL_DFS_PREORDER
apply(TransformNode, int, INodeApplicator)
,
apply(TransformNode, TransformNode, int, INodeApplicator)
,
Constant Field Valuespublic static final int TRAVERSAL_DFS_POSTORDER
apply(TransformNode, int, INodeApplicator)
,
apply(TransformNode, TransformNode, int, INodeApplicator)
,
Constant Field Valuespublic static final int TRAVERSAL_BFS
apply(TransformNode, int, INodeApplicator)
,
apply(TransformNode, TransformNode, int, INodeApplicator)
,
Constant Field Valuespublic static final int TRAVERSAL_DFS_PRE_AND_POSTORDER
apply(TransformNode, int, INodeApplicator)
,
apply(TransformNode, TransformNode, int, INodeApplicator)
,
Constant Field ValuesMethod Detail |
public static void apply(TransformNode parentNode, int traversal, INodeApplicator applicator)
applicator
to the given
TransformNode
and it's children in the given
traversal order.
traversal
- one of TRAVERSAL_DFS_PREORDER
or
TRAVERSAL_DFS_POSTORDER
applicator
- public static void apply(TransformNode parentNode, TransformNode node, int traversal, INodeApplicator applicator)
applicator
to the given
TransformNode
in the given traversal order.
parentNode
- the parent Node
of node
(or null
if node
is the
root node)node
- traversal
- one of TRAVERSAL_DFS_PREORDER
or
TRAVERSAL_DFS_POSTORDER
applicator
- public static boolean applyDFSRecursive(TransformNode grandParentNode, TransformNode parentNode, IDFSNodeApplicator applicator)
grandParentNode
- parentNode
- applicator
-
public static boolean applyDFS(TransformNode inGPNode, TransformNode inParentNode, IDFSNodeApplicator applicator)
inGPNode
- inParentNode
- applicator
-
public static boolean applyDFSMarkedEdges(TransformNode inGPNode, TransformNode inParentNode, IDFSNodeApplicator applicator)
applyDFS(TransformNode, TransformNode, IDFSNodeApplicator)
but only traverses marked edges.
inGPNode
- inParentNode
- applicator
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |