com.tensegrity.graph.algorithm
Interface DFSVisitor

All Known Implementing Classes:
BiconnectedDFS, DFSVisitorAdapter

public interface DFSVisitor

DFS Visitor pattern which has the callbacks for a DFS Visit.

Version:
$Id: DFSVisitor.java,v 1.1 2003/01/08 13:29:09 sr Exp $
Author:
Stepan Rutz

Method Summary
 void afterRecursion(Graph graph, Edge edge, Node node)
          Callback invoked right after the recursion in the dfs algorithm.
 void backEdge(Graph graph, Edge edge)
          Callback invoked each time a backedge is encountered for the first time.
 void beforeRecursion(Graph graph, Edge edge, Node node)
          Callback invoked right before the recursion in the dfs algorithm.
 void endGraph(Graph graph)
          Callback invoked after the dfs algorithm completed its work.
 void endNode(Graph graph, Node node, Node father)
          Callback invoked after the dfs algorithm has processed a single node (and all children recursively).
 void startDFSTree(Graph graph, Node node)
          Callback invoked each time a new dfs-tree is started in the dfs search forest.
 void startGraph(Graph graph)
          Callback invoked before the dfs algorithm starts its work.
 void startNode(Graph graph, Node node, Node father)
          Callback invoked before the dfs algorithm processes a single node.
 void usedAdjacentNodeEncountered(Graph graph, Edge edge, Node node)
          If the adjacent nodes of the current node are scanned and an already processed node is encountered, this method is invoked.
 

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.

startNode

public void startNode(Graph graph,
                      Node node,
                      Node father)
Callback invoked before the dfs algorithm processes a single node.

Parameters:
graph - graph the algorithm is working upon.
node - the currently processed node
father - the predecessor of the node, or null if the node has no predecessor in the dfs search order.

endNode

public void endNode(Graph graph,
                    Node node,
                    Node father)
Callback invoked after the dfs algorithm has processed a single node (and all children recursively).

Parameters:
graph - graph the algorithm is working upon.
node - the currently processed node
father - the predecessor of the node, or null if the node has no predecessor in the dfs search order.

beforeRecursion

public void beforeRecursion(Graph graph,
                            Edge edge,
                            Node node)
Callback invoked right before the recursion in the dfs algorithm.

Parameters:
graph - graph the algorithm is working upon.
edge - the edge that lead to the recursion.
node - the node that is going to be examined recursively next.

afterRecursion

public void afterRecursion(Graph graph,
                           Edge edge,
                           Node node)
Callback invoked right after the recursion in the dfs algorithm.

Parameters:
graph - graph the algorithm is working upon.
edge - the edge that lead to the recursion.
node - the node that was just recently examined recursively.

backEdge

public void backEdge(Graph graph,
                     Edge edge)
Callback invoked each time a backedge is encountered for the first time.

Parameters:
graph - graph the algorithm is working upon.
edge - the backedge.

usedAdjacentNodeEncountered

public void usedAdjacentNodeEncountered(Graph graph,
                                        Edge edge,
                                        Node node)
If the adjacent nodes of the current node are scanned and an already processed node is encountered, this method is invoked.

Parameters:
graph - graph the algorithm is working upon.
edge - the edge that connected the already seen node.
node - the node that was already visited.

startDFSTree

public void startDFSTree(Graph graph,
                         Node node)
Callback invoked each time a new dfs-tree is started in the dfs search forest. The passed node is the root node of the single dfs-tree.

Parameters:
graph - graph the algorithm is working upon.
node - the root node of one dfs tree.


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