public final class PackageSorter
extends java.lang.Object
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.
Modifier and Type | Class and Description |
---|---|
private static class |
PackageSorter.SortModule
An Internal wrapper class which collects additional information
on the given module.
|
Modifier | Constructor and Description |
---|---|
private |
PackageSorter()
DefaultConstructor.
|
Modifier and Type | Method and Description |
---|---|
private static java.util.ArrayList |
collectSubsystemModules(Module childMod,
java.util.HashMap moduleMap)
Collects all directly dependent subsystems.
|
private static boolean |
isBaseModule(Module mod,
ModuleInfo mi)
Checks, whether a module is a base module of an given module.
|
private static int |
searchModulePosition(PackageSorter.SortModule smodule,
java.util.HashMap moduleMap)
Computes the new module position.
|
static void |
sort(java.util.List modules)
Sorts the given list of package states.
|
public static void sort(java.util.List modules)
modules
- the list of modules.private static int searchModulePosition(PackageSorter.SortModule smodule, java.util.HashMap moduleMap)
smodule
- the sort module for that we compute the new positon.moduleMap
- the map with all modules.private static boolean isBaseModule(Module mod, ModuleInfo mi)
mod
- the module which to checkmi
- the module info of the suspected base module.private static java.util.ArrayList collectSubsystemModules(Module childMod, java.util.HashMap moduleMap)
childMod
- the module which to checkmoduleMap
- the map of all other modules, keyed by module class.