org.qi4j.spi.util
Class UsageGraph<K>

java.lang.Object
  extended by org.qi4j.spi.util.UsageGraph<K>

public final class UsageGraph<K>
extends Object

This class is NOT thread-safe. //TODO: Algorithm need to be optimized.


Nested Class Summary
static interface UsageGraph.Use<K>
           
 
Constructor Summary
UsageGraph(Collection<K> data, UsageGraph.Use<K> use, boolean allowCyclic)
           
 
Method Summary
 void invalidate()
          Must be called if the data set has been modified.
 List<K> resolveOrder()
           
 boolean transitiveUse(K source, K other)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UsageGraph

public UsageGraph(Collection<K> data,
                  UsageGraph.Use<K> use,
                  boolean allowCyclic)
Method Detail

transitiveUse

public boolean transitiveUse(K source,
                             K other)

invalidate

public void invalidate()
Must be called if the data set has been modified.


resolveOrder

public List<K> resolveOrder()