KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > quilt > graph > Visitor


1 /* Visitor.java */
2
3 package org.quilt.graph;
4
5 /**
6  * Methods for visiting a Quilt directed graph. Implementations
7  * can assume that a walk across the graph using Walker will touch every
8  * vertex and edge in the target graph and in every subgraph once
9  * and only once. Entry and exit points are in their graphs.
10  *
11  * @author <a HREF="jddixon@users.sourceforge.net">Jim Dixon</a>
12  */

13 public interface Visitor {
14     /** Called at beginning of visiting a graph or subgraph. */
15     public void discoverGraph (Directed graph);
16     
17     /** Called at end of visiting a graph or subgraph. */
18     public void finishGraph (Directed graph);
19     
20     /**
21      * Called when beginning visit to vertex. If the vertex is
22      * the entry point for a subgraph, discoverGraph for that
23      * subgraph must be called during the visit.
24      */

25     public void discoverVertex(Vertex vertex);
26     /**
27      * Called at end of vertex visit. If the vertex is an exit
28      * point for a subgraph, finishGraph for the subgraph must
29      * be called during the visit.
30      */

31     public void finishVertex (Vertex vertex);
32     
33     /** Called when initially visiting edge. */
34     public void discoverEdge (Edge edge);
35     
36     /** Called at end of visit to edge. */
37     public void finishEdge (Edge edge);
38 }
39
Popular Tags