com.tensegrity.graph.algorithm
Interface BFSVisitor

All Known Implementing Classes:
BFSVisitorAdapter

public interface BFSVisitor

This interface defines a breadth first graph visitor. An instance of this visitor serves as callback for the BFS algorithm according to the Visitor pattern.

Version:
$Id: BFSVisitor.java,v 1.4 2004/01/05 15:15:47 sr Exp $
Author:
StepanRutz

Method Summary
 void endGraph(Graph graph)
          Callback invoked after the dfs algorithm completed its work.
 void startGraph(Graph graph)
          Callback invoked before the dfs algorithm starts its work.
 void visitEdge(Graph graph, Edge edge, boolean treeEdge)
          Invoked when an edge is processed by the BFS.
 void visitNode(Graph graph, Node node, Node parent, int depth)
          Invoked when a node is processed by the BFS.
 

Method Detail

startGraph

public void startGraph(Graph graph)
Callback invoked before the dfs algorithm starts its work.

Parameters:
graph - graph the algorithm is working upon.

endGraph

public void endGraph(Graph graph)
Callback invoked after the dfs algorithm completed its work.

Parameters:
graph - graph the algorithm is working upon.

visitNode

public void visitNode(Graph graph,
                      Node node,
                      Node parent,
                      int depth)
Invoked when a node is processed by the BFS.

Parameters:
graph - the graph we visit
node - the node currently being visited.
parent - the parent of the node or null if no parent was found.
depth - the depth of the bfs search.

visitEdge

public void visitEdge(Graph graph,
                      Edge edge,
                      boolean treeEdge)
Invoked when an edge is processed by the BFS.

Parameters:
graph - the graph we visit.
edge - the edge currently being visited.
treeEdge - true if this edge is a tree edge of the BFS search tree.


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.