1 11 package org.eclipse.update.search; 12 13 import java.util.ArrayList ; 14 15 import org.eclipse.core.runtime.*; 16 import org.eclipse.update.core.*; 17 18 19 33 public class VersionedIdentifiersFilter extends BaseFilter { 34 private ArrayList vids; 35 36 public VersionedIdentifiersFilter() { 37 this(new VersionedIdentifier[0]); 38 } 39 40 public VersionedIdentifiersFilter(VersionedIdentifier[] vids) { 41 this.vids = new ArrayList (vids.length); 42 for (int i=0; i<vids.length; i++) 43 this.vids.add(vids[i]); 44 } 45 46 public void add(VersionedIdentifier vid) { 47 vids.add(vid); 48 } 49 50 public boolean accept(IFeatureReference match) { 51 try { 52 for (int i=0; i<vids.size(); i++) { 53 VersionedIdentifier vid = (VersionedIdentifier)vids.get(i); 54 if (vid.equals(match.getVersionedIdentifier())) 56 return true; 57 } 58 return false; 59 } catch (CoreException e) { 60 return false; 61 } 62 } 63 } 64 | Popular Tags |