com.irisel.modules
Class PackageSorter

java.lang.Object
  extended by com.irisel.modules.PackageSorter

public final class PackageSorter
extends java.lang.Object

Compares two modules for order. A module is considered less than an other module if the module is a required module of the compared module. Modules are considered equal if they have no relation.

When sorting, we match this modules position against all dependent modules until all positions are stable. Circular references are evil and are filtered during the module loading process in the package manager.

Author:
Thomas Morgner

Method Summary
static void sort(java.util.List modules)
          Sorts the given list of package states.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

sort

public static void sort(java.util.List modules)
Sorts the given list of package states. ToDo: The algorithm used is simple and not optimized, we could write something better in a near future.

Parameters:
modules - the list of modules.