jInfer

cz.cuni.mff.ksi.jinfer.base.utils
Class TopologicalSort

java.lang.Object
  extended by cz.cuni.mff.ksi.jinfer.base.utils.TopologicalSort

public final class TopologicalSort
extends Object

Topological sorting of elements. In the DAG where sorting takes place, elements are vertices and edges go from depending to dependant elements.


Constructor Summary
TopologicalSort(List<Element> elements)
          Constructor of the toposorting class.
 
Method Summary
 List<Element> sort()
          Performs the topological sorting and returns a list of sorted elements.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TopologicalSort

public TopologicalSort(List<Element> elements)
Constructor of the toposorting class. All elements that should be sorted must be specified at this moment.

Parameters:
elements - Elements to be toposorted.
Method Detail

sort

public List<Element> sort()
                   throws InterruptedException
Performs the topological sorting and returns a list of sorted elements.

Returns:
List of toposorted elements.
Throws:
InterruptedException - If this sorting is interrupted.

jInfer

Generated on Fri Dec 9 00:01:25 CET 2011