|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.iotabits.revisitor.BasicVisitable
com.iotabits.examples.revisitor.GraphNode
This class provides an example of using the revisitor with a passback. These nodes can be used to represent a directed acyclic graph (DAG).
Nested Class Summary | |
static class |
GraphNode.GraphPrinter
Our simple visitor. |
Constructor Summary | |
GraphNode(java.lang.Object data,
GraphNode[] children)
ctor |
Method Summary | |
void |
accept(iReflectiveVisitor visitor)
Graph traversal |
GraphNode[] |
getChildren()
Return all the directly accessible adjacent nodes. |
static void |
main(java.lang.String[] args)
This is a simple test program that constructs a simple graph and then iterates over it using the GraphPrinter visitor class. |
void |
traverse(iReflectiveVisitor visitor)
If we could make the accept private, we would. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public GraphNode(java.lang.Object data, GraphNode[] children)
Method Detail |
public GraphNode[] getChildren()
public void accept(iReflectiveVisitor visitor) throws java.lang.Exception
accept
in interface iVisitable
accept
in class BasicVisitable
visitor
-
java.lang.Exception
public void traverse(iReflectiveVisitor visitor) throws java.lang.Exception
visitor
-
java.lang.Exception
public static void main(java.lang.String[] args)
args
-
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |