com.tensegrity.graph.algorithm
Class BFSVisitorAdapter

java.lang.Object
  extended bycom.tensegrity.graph.algorithm.BFSVisitorAdapter
All Implemented Interfaces:
BFSVisitor

public abstract class BFSVisitorAdapter
extends java.lang.Object
implements BFSVisitor

This defines a bfs graph visitor adapter for convenience. All methods from the interface BFSVisitor are implemented as empty methods in this adapter class.

Version:
$Id: BFSVisitor.java,v 1.2 2003/01/09 11:36:41 sr Exp $
Author:
StepanRutz

Constructor Summary
BFSVisitorAdapter()
          Constructs a new BFSVisitorAdapter adapter instance.
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BFSVisitorAdapter

public BFSVisitorAdapter()
Constructs a new BFSVisitorAdapter adapter instance.

Method Detail

startGraph

public void startGraph(Graph graph)
Description copied from interface: BFSVisitor
Callback invoked before the dfs algorithm starts its work.

Specified by:
startGraph in interface BFSVisitor
Parameters:
graph - graph the algorithm is working upon.

endGraph

public void endGraph(Graph graph)
Description copied from interface: BFSVisitor
Callback invoked after the dfs algorithm completed its work.

Specified by:
endGraph in interface BFSVisitor
Parameters:
graph - graph the algorithm is working upon.

visitNode

public void visitNode(Graph graph,
                      Node node,
                      Node parent,
                      int depth)
Description copied from interface: BFSVisitor
Invoked when a node is processed by the BFS.

Specified by:
visitNode in interface BFSVisitor
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)
Description copied from interface: BFSVisitor
Invoked when an edge is processed by the BFS.

Specified by:
visitEdge in interface BFSVisitor
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.