public abstract class ModuleVersionSpec extends Object implements Spec<org.apache.ivy.core.module.id.ModuleId>
This class attempts to reduce execution time, by flattening union and intersection specs, at the cost of more analysis at construction time. This is taken advantage of by DependencyGraphBuilder, on the assumption that there are many more edges in the dependency graph than there are exclude rules (ie we evaluate the rules much more often that we construct them).
Also, this class attempts to be quite accurate in determining if 2 specs will match exactly the same set of modules. DependencyGraphBuilder uses this to avoid traversing the
dependency graph of a particular version that has already been traversed when a new incoming edge is added (eg a newly discovered dependency) and when an incoming edge is removed (eg a conflict
evicts a version that depends on the given version).
| Constructor and Description |
|---|
ModuleVersionSpec() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
acceptsSameModulesAs(ModuleVersionSpec other)
Determines if this spec accepts the same set of modules as the given spec.
|
protected boolean |
doAcceptsSameModulesAs(ModuleVersionSpec other)
Only called when this and the other spec have the same class.
|
protected ModuleVersionSpec |
doIntersection(ModuleVersionSpec other) |
protected ModuleVersionSpec |
doUnion(ModuleVersionSpec other) |
static ModuleVersionSpec |
forExcludes(Collection<org.apache.ivy.core.module.descriptor.ExcludeRule> excludeRules)
Returns a spec that accepts only those module versions that do not match any of the
|
static ModuleVersionSpec |
forExcludes(org.apache.ivy.core.module.descriptor.ExcludeRule... excludeRules) |
ModuleVersionSpec |
intersect(ModuleVersionSpec other)
Returns a spec that accepts the intersection of those module versions that are accepted by this spec and the given spec.
|
ModuleVersionSpec |
union(ModuleVersionSpec other)
Returns a spec that accepts the union of those module versions that are accepted by this spec and the given spec.
|
protected void |
unpackUnion(Collection<ModuleVersionSpec> specs) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisSatisfiedBypublic static ModuleVersionSpec forExcludes(org.apache.ivy.core.module.descriptor.ExcludeRule... excludeRules)
public static ModuleVersionSpec forExcludes(Collection<org.apache.ivy.core.module.descriptor.ExcludeRule> excludeRules)
public final ModuleVersionSpec union(ModuleVersionSpec other)
protected void unpackUnion(Collection<ModuleVersionSpec> specs)
protected ModuleVersionSpec doUnion(ModuleVersionSpec other)
public final boolean acceptsSameModulesAs(ModuleVersionSpec other)
protected boolean doAcceptsSameModulesAs(ModuleVersionSpec other)
public final ModuleVersionSpec intersect(ModuleVersionSpec other)
protected ModuleVersionSpec doIntersection(ModuleVersionSpec other)
Copyright © 2013. All rights reserved