Package org.xdams.xw.utility

Examples of org.xdams.xw.utility.XWComparator


        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>();
View Full Code Here


          }
          e.printStackTrace();
        }
      }
      // Arrays.sort(values);
      Arrays.sort(values, new XWComparator());
      // Arrays.sort(values,Collator.getInstance(Locale.ITALIAN));
      // System.out.println(param.trim()+" = "+values[0]+" = "+startParam);
      if (param.trim().equalsIgnoreCase(values[0])) {
        result = true;
      } else {
View Full Code Here

TOP

Related Classes of org.xdams.xw.utility.XWComparator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.