01: /* Visitor.java */
02:
03: package org.quilt.graph;
04:
05: /**
06: * Methods for visiting a Quilt directed graph. Implementations
07: * can assume that a walk across the graph using Walker will touch every
08: * vertex and edge in the target graph and in every subgraph once
09: * 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: /**
28: * Called at end of vertex visit. If the vertex is an exit
29: * point for a subgraph, finishGraph for the subgraph must
30: * be called during the visit.
31: */
32: public void finishVertex(Vertex vertex);
33:
34: /** Called when initially visiting edge. */
35: public void discoverEdge(Edge edge);
36:
37: /** Called at end of visit to edge. */
38: public void finishEdge(Edge edge);
39: }
|