implemented search result sorting on client side
git-svn-id: svn://anubis/gvsu@64 45c1a28c-8058-47b2-ae61-ca45b979098e
This commit is contained in:
parent
4915272ada
commit
111b16aecd
@ -127,6 +127,21 @@ public class KaZaClient
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e) { }
|
catch (Exception e) { }
|
||||||
|
|
||||||
|
/* sort the results by the connection speed */
|
||||||
|
Object[] arr = results.toArray();
|
||||||
|
java.util.Arrays.sort(arr, new Comparator() {
|
||||||
|
public int compare(Object o1, Object o2) {
|
||||||
|
return ((SearchResult)o1).speed - ((SearchResult)o2).speed;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
results = new Vector<SearchResult>();
|
||||||
|
for (Object o : arr)
|
||||||
|
{
|
||||||
|
results.add((SearchResult) o);
|
||||||
|
}
|
||||||
|
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user