1 11 package org.eclipse.core.internal.dependencies; 12 13 import java.util.*; 14 15 18 19 public class SimpleSelectionPolicy implements ISelectionPolicy { 20 public Set selectMultiple(ElementSet elementSet) { 21 return new HashSet(elementSet.getSatisfied()); 23 } 24 25 public Element selectSingle(ElementSet elementSet) { 26 Element highest = null; 28 for (Iterator satisfiedIter = elementSet.getSatisfied().iterator(); satisfiedIter.hasNext();) { 29 Element satisfiedVersion = (Element) satisfiedIter.next(); 30 if (highest == null || elementSet.getSystem().compare(satisfiedVersion.getVersionId(), highest.getVersionId()) > 0) 31 highest = satisfiedVersion; 32 } 33 return highest; 34 } 35 } | Popular Tags |