Your browser does not support JavaScript and this site utilizes JavaScript to build content and provide links to additional information. You should either enable JavaScript in your browser settings or use a browser that supports JavaScript in order to take full advantage of this site.
1 11 package org.eclipse.osgi.internal.module; 12 13 import java.util.ArrayList ; 14 import org.eclipse.osgi.service.resolver.VersionConstraint; 15 16 public class GenericConstraint extends ResolverConstraint { 17 private ArrayList matchingCapability; 18 19 GenericConstraint(ResolverBundle bundle, VersionConstraint constraint) { 20 super(bundle, constraint); 21 } 22 23 boolean isOptional() { 24 return false; 25 } 26 27 boolean isSatisfiedBy(VersionSupplier vs) { 28 return getVersionConstraint().isSatisfiedBy(vs.getBaseDescription()); 29 } 30 31 public void setMatchingCapability(GenericCapability capability) { 32 if (capability == null) { 33 matchingCapability = null; 34 return; 35 } 36 if (matchingCapability == null) 37 matchingCapability = new ArrayList (1); 38 matchingCapability.add(capability); 39 } 40 41 public GenericCapability[] getMatchingCapabilities() { 42 return matchingCapability == null || matchingCapability.size() == 0 ? null : (GenericCapability[]) matchingCapability.toArray(new GenericCapability[matchingCapability.size()]); 43 } 44 45 void removeMatchingCapability(GenericCapability capability) { 46 if (matchingCapability != null) 47 matchingCapability.remove(capability); 48 } 49 } 50
| Popular Tags
|