org.testinium.graph
Class DFS

java.lang.Object
  extended by org.testinium.graph.DFS
All Implemented Interfaces:
INodesSorter

public class DFS
extends java.lang.Object
implements INodesSorter

DFS implementation and Topological Sort http://www.cis.temple.edu/~pwang/551-PT/Lecture/551-0415.htm

Version:
1.0
Author:
Thierry Janaudy janaudy@testinium.org

Constructor Summary
DFS()
          DFS
 
Method Summary
 java.util.List<INode> processNodesGraph(java.util.Collection<INode> nodesList)
          processNodesGraph is the method you should implement to provide your own sorting algorithm
 void visit(INode node)
          visit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DFS

public DFS()
DFS

Method Detail

processNodesGraph

public java.util.List<INode> processNodesGraph(java.util.Collection<INode> nodesList)
                                        throws java.lang.Exception
Description copied from interface: INodesSorter
processNodesGraph is the method you should implement to provide your own sorting algorithm

Specified by:
processNodesGraph in interface INodesSorter
Returns:
a sorted list of nodes
Throws:
CycleException
java.lang.Exception
See Also:
INodesSorter.processNodesGraph(Collection)

visit

public void visit(INode node)
           throws CycleException
visit

Parameters:
node -
Throws:
CycleException