org.codehaus.plexus.util.dag
Class TopologicalSorter

java.lang.Object
  extended by org.codehaus.plexus.util.dag.TopologicalSorter

public class TopologicalSorter
extends java.lang.Object

Version:
$Id: TopologicalSorter.java 5958 2007-02-28 10:29:55Z olamy $
Author:
Michal Maczka

Field Summary
private static java.lang.Integer NOT_VISTITED
           
private static java.lang.Integer VISITED
           
private static java.lang.Integer VISITING
           
 
Constructor Summary
TopologicalSorter()
           
 
Method Summary
private static java.util.List dfs(DAG graph)
           
private static void dfsVisit(Vertex vertex, java.util.Map vertexStateMap, java.util.LinkedList list)
           
private static boolean isNotVisited(Vertex vertex, java.util.Map vertexStateMap)
           
static java.util.List sort(DAG graph)
           
static java.util.List sort(Vertex vertex)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NOT_VISTITED

private static final java.lang.Integer NOT_VISTITED

VISITING

private static final java.lang.Integer VISITING

VISITED

private static final java.lang.Integer VISITED
Constructor Detail

TopologicalSorter

public TopologicalSorter()
Method Detail

sort

public static java.util.List sort(DAG graph)
Parameters:
graph -
Returns:
List of String (vertex labels)

sort

public static java.util.List sort(Vertex vertex)

dfs

private static java.util.List dfs(DAG graph)

isNotVisited

private static boolean isNotVisited(Vertex vertex,
                                    java.util.Map vertexStateMap)
Parameters:
vertex -
vertexStateMap -
Returns:

dfsVisit

private static void dfsVisit(Vertex vertex,
                             java.util.Map vertexStateMap,
                             java.util.LinkedList list)