public static ArrayList sortedSetToArrayList(SortedSet set,int query) {
ArrayList array = new ArrayList();
Iterator iter = set.iterator();
String name="";
MatchedService service;
while(iter.hasNext()){
service = (MatchedService)iter.next();
name = (service).serviceURI.toString();
log("" + query + " - " + service.toString());
array.add(name.substring(name.lastIndexOf("/")+1));
}
return array;
}