Package org.apache.ivy.core.sort
Class SortEngine
- java.lang.Object
-
- org.apache.ivy.core.sort.SortEngine
-
public class SortEngine extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description SortEngine(SortEngineSettings settings)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected CircularDependencyStrategy
getCircularStrategy()
protected VersionMatcher
getVersionMatcher()
java.util.List<ModuleDescriptor>
sortModuleDescriptors(java.util.Collection<ModuleDescriptor> moduleDescriptors, SortOptions options)
Sorts the given ModuleDescriptors from the less dependent to the more dependent.java.util.List<IvyNode>
sortNodes(java.util.Collection<IvyNode> nodes, SortOptions options)
Same assortModuleDescriptors(Collection, SortOptions)
but forIvyNode
s.
-
-
-
Constructor Detail
-
SortEngine
public SortEngine(SortEngineSettings settings)
-
-
Method Detail
-
sortNodes
public java.util.List<IvyNode> sortNodes(java.util.Collection<IvyNode> nodes, SortOptions options)
Same assortModuleDescriptors(Collection, SortOptions)
but forIvyNode
s.- Parameters:
nodes
- a Collection of nodes to sortoptions
- Options to use to sort the nodes.- Returns:
- a List of sorted IvyNode
- Throws:
CircularDependencyException
- if a circular dependency exists and circular dependency strategy decide to throw an exception
-
sortModuleDescriptors
public java.util.List<ModuleDescriptor> sortModuleDescriptors(java.util.Collection<ModuleDescriptor> moduleDescriptors, SortOptions options) 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 sortoptions
- Options to use to sort the descriptors.- Returns:
- a List of sorted ModuleDescriptors
- Throws:
CircularDependencyException
- if a circular dependency exists and circular dependency strategy decide to throw an exception
-
getCircularStrategy
protected CircularDependencyStrategy getCircularStrategy()
-
getVersionMatcher
protected VersionMatcher getVersionMatcher()
-
-