code: public int compare(Class o1, Class o2) {
      String        s1;
      String        s2;
      int           i;
      int           result;
      int           v1;
      int           v2;
  
      result = 0;   // they're equal
  
      // get lower case string
      s1 = o1.getName().toLowerCase();
      s2 = o2.getName().toLowerCase();
  
      // same length
      s1 = fillUp(s1, s2.length());
      s2 = fillUp(s2, s1.length());
  
      for (i = 0; i < s1.length(); i++) {
        // same char?
        if (s1.charAt(i) == s2.charAt(i)) {
          result = 0;
        }
        else {
          v1 = charGroup(s1.charAt(i));
          v2 = charGroup(s2.charAt(i));
  
          // different type (special, number, letter)?
          if (v1 != v2) {
            if (v1 < v2)
              result = -1;
            else
              result = 1;
          }
          else {
            if (s1.charAt(i) < s2.charAt(i))
              result = -1;
            else
              result = 1;
          }
  
          break;
        }
      }
  
      return result;
    }
docs: Compares its two arguments for order.
  
  @param o1		the first class
  @param o2		the second class
  @return		-1 if o1&lt;o2, 0 if o1=o2 and 1 if o1&;gt;o2