fr.jayasoft.ivy
Class ModuleDescriptorSorter

java.lang.Object
  extended byfr.jayasoft.ivy.ModuleDescriptorSorter

class ModuleDescriptorSorter
extends java.lang.Object

Inner helper class for sorting ModuleDescriptors.

Author:
baumkar (for most of the code), xavier hanin (for the sorting of nodes based upon sort of modules)

Constructor Summary
ModuleDescriptorSorter(java.util.Collection moduleDescriptors)
           
 
Method Summary
 java.util.List sortModuleDescriptors()
          Iterates over all modules calling sortModuleDescriptorsHelp.
static java.util.List sortModuleDescriptors(java.util.Collection moduleDescriptors)
          Sorts the given ModuleDescriptors from the less dependent to the more dependent.
static java.util.List sortNodes(java.util.Collection nodes)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModuleDescriptorSorter

public ModuleDescriptorSorter(java.util.Collection moduleDescriptors)
Method Detail

sortNodes

public static java.util.List sortNodes(java.util.Collection nodes)

sortModuleDescriptors

public static java.util.List sortModuleDescriptors(java.util.Collection moduleDescriptors)
                                            throws CircularDependencyException
Sorts the given ModuleDescriptors from the less dependent to the more dependent. This sort ensures that a ModuleDescriptor is always found in the list before all ModuleDescriptors depending directly on it.

Parameters:
moduleDescriptors - a Collection of ModuleDescriptor to sort
Returns:
a List of sorted ModuleDescriptors
Throws:
CircularDependencyException - if a circular dependency exists

sortModuleDescriptors

public java.util.List sortModuleDescriptors()
                                     throws CircularDependencyException
Iterates over all modules calling sortModuleDescriptorsHelp.

Returns:
sorted module
Throws:
CircularDependencyException