ix.util
Class TopologicalSorter

java.lang.Object
  extended by ix.util.TopologicalSorter
Direct Known Subclasses:
PlanCheckingSimulator.ExecOrderSorter, SimpleRSim.ExecOrderSorter

public abstract class TopologicalSorter
extends java.lang.Object

DAG topological sort, returning ancestors before descendents.

You should make a new sorter each time.


Constructor Summary
TopologicalSorter()
           
 
Method Summary
protected abstract  java.util.Collection getChildren(java.lang.Object node)
           
 java.util.List sort(java.util.Collection roots)
           
protected  void walk(java.util.Collection items)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TopologicalSorter

public TopologicalSorter()
Method Detail

sort

public java.util.List sort(java.util.Collection roots)

walk

protected void walk(java.util.Collection items)

getChildren

protected abstract java.util.Collection getChildren(java.lang.Object node)