e.printStackTrace();
}
Object objs[] = newResult.toArray();
// Arrays.sort(objs);
// Arrays.sort(objs,Collator.getInstance(Locale.ITALIAN));
Arrays.sort(objs, new XWComparator());
// newResult.removeAllElements();
newResult.clear();
Map<String, Integer> summKeys = new TreeMap<String, Integer>();
for (int i = 0; i < objs.length; i++) {
String keyString = (String) objs[i];
String sKey = keyString.substring(0, keyString.indexOf("~"));
String sFrequence = keyString.substring(keyString.indexOf("~") + 1, keyString.length());
int laFrequenza = Integer.parseInt(sFrequence);
if (summKeys.get(sKey) != null) {
summKeys.put(sKey, new Integer(((Integer) summKeys.get(sKey)).intValue() + laFrequenza));
} else {
summKeys.put(sKey, new Integer(laFrequenza));
}
}
// String keyH;
// for (Enumeration enumeration2 = summKeys.keys(); enumeration2.hasMoreElements(); newResult.add(keyH + "~" + ((Integer) summKeys.get(keyH)).toString()))
// keyH = (String) enumeration2.nextElement();
for (Entry<String, Integer> entry : summKeys.entrySet()) {
String keyH = entry.getKey();
newResult.add(keyH + "~" + ((Integer) summKeys.get(keyH)).toString());
}
objs = newResult.toArray();
// Arrays.sort(objs);
// Arrays.sort(objs,Collator.getInstance(Locale.ITALIAN));
Arrays.sort(objs, new XWComparator());
// newResult.removeAllElements();
newResult.clear();
List<Key> newResultKey = new ArrayList<Key>();
// newResult = new ArrayList<String>();