1 package org.columba.core.search; 2 3 import java.util.Hashtable ; 4 import java.util.Iterator ; 5 import java.util.List ; 6 7 import org.columba.core.search.api.ISearchResult; 8 9 public class DistinctResultHelper { 10 11 14 public static void removeDuplicated(List <ISearchResult> list) { 15 Hashtable <String , String > hashtable = new Hashtable <String , String >(); 17 18 Iterator <ISearchResult> it = list.iterator(); 19 while (it.hasNext()) { 20 ISearchResult r = it.next(); 21 22 if ( hashtable.containsKey(r.getLocation().toString())) 24 it.remove(); 25 else 26 hashtable.put(r.getLocation().toString(), r.getLocation().toString()); 28 } 29 } 30 } 31 | Popular Tags |