Class CollectionOfModulesToSort

  • All Implemented Interfaces:
    java.lang.Iterable<ModuleInSort>

    class CollectionOfModulesToSort
    extends java.lang.Object
    implements java.lang.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.

    • Constructor Detail

      • CollectionOfModulesToSort

        public CollectionOfModulesToSort​(java.util.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 Detail

      • iterator

        public java.util.Iterator<ModuleInSort> iterator()
        Specified by:
        iterator in interface java.lang.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.