cz.cuni.mff.ksi.jinfer.base.utils
Class TopologicalSort
java.lang.Object
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.
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 |
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.
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.
Generated on Fri Dec 9 00:01:25 CET 2011