protected boolean isGreedy(IRequirement req) { return req.isGreedy(); }
protected boolean isGreedy(IRequirement req) { return req.isGreedy(); }
public boolean equals(Object obj) { if (this == obj) return true; if (!(obj instanceof IRequirement)) return false; IRequirement other = (IRequirement) obj; if (filter == null) { if (other.getFilter() != null) return false; } else if (!filter.equals(other.getFilter())) return false; return min == other.getMin() && max == other.getMax() && greedy == other.isGreedy() && matchExpression.equals(other.getMatches()); }
Collection<IRequirement> reqs = metaIu.getRequirements(); for (IRequirement req : reqs) { if (req.getMin() > 0 || !req.isGreedy()) continue; IQueryResult<IInstallableUnit> matches = picker.query(QueryUtil.createMatchQuery(req.getMatches()), null);
missingRequirement(patch, req); } else { if (req.isGreedy()) { IInstallableUnit reqIu = matches.get(0); Explanation explanation; if (!matches.isEmpty()) { AbstractVariable abs; if (req.isGreedy()) { abs = getAbstractVariable(req); createImplication(new Object[] {patch, abs, iu}, matches, Explanation.OPTIONAL_REQUIREMENT); if (req.isGreedy()) { IInstallableUnit reqIu = matches.get(0);///(IInstallableUnit) picker.query(new CapabilityQuery(req), new Collector(), null).iterator().next(); Explanation explanation; if (req.isGreedy()) { abs = getAbstractVariable(req); if (req.isGreedy()) { IInstallableUnit reqIu = matches.get(0); Explanation explanation; matches.addAll(requiredPatches); AbstractVariable abs; if (req.isGreedy()) { abs = getAbstractVariable(req); createImplication(new Object[] {abs, iu}, matches, Explanation.OPTIONAL_REQUIREMENT);
protected void writeRequirement(IRequirement requirement) { start(REQUIREMENT_ELEMENT); IMatchExpression<IInstallableUnit> match = requirement.getMatches(); if (requirement.getMax() > 0 && RequiredCapability.isSimpleRequirement(match)) { attribute(NAMESPACE_ATTRIBUTE, RequiredCapability.extractNamespace(match)); attribute(NAME_ATTRIBUTE, RequiredCapability.extractName(match)); attribute(VERSION_RANGE_ATTRIBUTE, RequiredCapability.extractRange(match)); attribute(CAPABILITY_OPTIONAL_ATTRIBUTE, requirement.getMin() == 0, false); attribute(CAPABILITY_MULTIPLE_ATTRIBUTE, requirement.getMax() > 1, false); } else { writeMatchExpression(match); if (requirement.getMin() != 1) attribute(MIN_ATTRIBUTE, requirement.getMin()); if (requirement.getMax() != 1) attribute(MAX_ATTRIBUTE, requirement.getMax()); } attribute(CAPABILITY_GREED_ATTRIBUTE, requirement.isGreedy(), true); if (requirement.getFilter() != null) writeTrimmedCdata(CAPABILITY_FILTER_ELEMENT, requirement.getFilter().getParameters()[0].toString()); if (requirement.getDescription() != null) writeTrimmedCdata(REQUIREMENT_DESCRIPTION_ELEMENT, requirement.getDescription()); end(REQUIREMENT_ELEMENT); }
protected void writeRequirement(IRequirement requirement) { start(REQUIREMENT_ELEMENT); IMatchExpression<IInstallableUnit> match = requirement.getMatches(); if (requirement.getMax() > 0 && RequiredCapability.isSimpleRequirement(match)) { attribute(NAMESPACE_ATTRIBUTE, RequiredCapability.extractNamespace(match)); attribute(NAME_ATTRIBUTE, RequiredCapability.extractName(match)); attribute(VERSION_RANGE_ATTRIBUTE, RequiredCapability.extractRange(match)); attribute(CAPABILITY_OPTIONAL_ATTRIBUTE, requirement.getMin() == 0, false); attribute(CAPABILITY_MULTIPLE_ATTRIBUTE, requirement.getMax() > 1, false); } else { writeMatchExpression(match); if (requirement.getMin() != 1) attribute(MIN_ATTRIBUTE, requirement.getMin()); if (requirement.getMax() != 1) attribute(MAX_ATTRIBUTE, requirement.getMax()); } attribute(CAPABILITY_GREED_ATTRIBUTE, requirement.isGreedy(), true); if (requirement.getFilter() != null) writeTrimmedCdata(CAPABILITY_FILTER_ELEMENT, requirement.getFilter().getParameters()[0].toString()); if (requirement.getDescription() != null) writeTrimmedCdata(REQUIREMENT_DESCRIPTION_ELEMENT, requirement.getDescription()); end(REQUIREMENT_ELEMENT); }
protected void writeRequirement(IRequirement requirement) { start(REQUIREMENT_ELEMENT); IMatchExpression<IInstallableUnit> match = requirement.getMatches(); if (requirement.getMax() > 0 && RequiredCapability.isSimpleRequirement(match)) { attribute(NAMESPACE_ATTRIBUTE, RequiredCapability.extractNamespace(match)); attribute(NAME_ATTRIBUTE, RequiredCapability.extractName(match)); attribute(VERSION_RANGE_ATTRIBUTE, RequiredCapability.extractRange(match)); attribute(CAPABILITY_OPTIONAL_ATTRIBUTE, requirement.getMin() == 0, false); attribute(CAPABILITY_MULTIPLE_ATTRIBUTE, requirement.getMax() > 1, false); } else { writeMatchExpression(match); if (requirement.getMin() != 1) attribute(MIN_ATTRIBUTE, requirement.getMin()); if (requirement.getMax() != 1) attribute(MAX_ATTRIBUTE, requirement.getMax()); } attribute(CAPABILITY_GREED_ATTRIBUTE, requirement.isGreedy(), true); if (requirement.getFilter() != null) writeTrimmedCdata(CAPABILITY_FILTER_ELEMENT, requirement.getFilter().getParameters()[0].toString()); if (requirement.getDescription() != null) writeTrimmedCdata(REQUIREMENT_DESCRIPTION_ELEMENT, requirement.getDescription()); end(REQUIREMENT_ELEMENT); }