Class CollectionOfModulesToSort

java.lang.Object
org.apache.ivy.core.sort.CollectionOfModulesToSort
All Implemented Interfaces:
Iterable<ModuleInSort>

class CollectionOfModulesToSort extends Object implements Iterable<ModuleInSort>
Wrap a collection of descriptors wrapped themselves in ModuleInSort elements. It contains some dedicated function to retrieve module descriptors based on dependencies descriptors.

This class is designed to be used internally by the ModuleDescriptorSorter.

  • Field Details

  • Constructor Details

    • CollectionOfModulesToSort

      public CollectionOfModulesToSort(Collection<ModuleDescriptor> modulesToSort, VersionMatcher matcher, NonMatchingVersionReporter nonMatchingVersionReporter)
      Parameters:
      modulesToSort - The collection of ModuleDescriptor to sort
      matcher - The matcher to used to check if dependencyDescriptor match a module in this collection
      nonMatchingVersionReporter - ditto
  • Method Details

    • addToModulesByModuleId

      private void addToModulesByModuleId(ModuleDescriptor md, ModuleInSort mdInSort)
    • iterator

      public Iterator<ModuleInSort> iterator()
      Specified by:
      iterator in interface Iterable<ModuleInSort>
    • size

      public int size()
    • getModuleDescriptorDependency

      public ModuleInSort getModuleDescriptorDependency(DependencyDescriptor descriptor)
      Find a matching module descriptor in the list of module to sort.
      Parameters:
      descriptor - ditto
      Returns:
      a ModuleDescriptor from the collection of module descriptors to sort. If none exists returns null.