Package java.text

Examples of java.text.Collator.compare()


            return versionRange;
        }

        public int compareTo(PackageRequirement o) {
            Collator collator = Collator.getInstance();
            int i = collator.compare(getName(), o.getName());
            if (i == 0) {
                i = getVersionRange().toString().compareTo(o.getVersionRange().toString());
            }
            return i;
        }
View Full Code Here


     *
     * @return true if the bug is present, false otherwise
     */
    private static boolean hasBuggySwedishLocale() {
        Collator c = Collator.getInstance(new Locale("sv"));
        if (c.compare("aa", "ab") < 0) {
            // OK, aa should be less than ab with Swedish collation
            return false;
        } else {
            // this is a bug
            return true;
View Full Code Here

     *
     * @return true if the bug is present, false otherwise
     */
    private static boolean hasBuggySwedishLocale() {
        Collator c = Collator.getInstance(new Locale("sv"));
        if (c.compare("aa", "ab") < 0) {
            // OK, aa should be less than ab with Swedish collation
            return false;
        } else {
            // this is a bug
            return true;
View Full Code Here

    return fun_MATCH_Sorted( _x, _xs, c, new Comparator<String>()
    {

      public int compare( String _o1, String _o2 )
      {
        return c.compare( _o1, _o2 );
      }

    } );
  }
View Full Code Here

    return fun_MATCH_Sorted( _x, _xs, c, new Comparator<String>()
    {

      public int compare( String _o1, String _o2 )
      {
        return -c.compare( _o1, _o2 );
      }

    } );
  }
View Full Code Here

            return version;
        }

        public int compareTo(PackageCapability o) {
            Collator collator = Collator.getInstance();
            int i = collator.compare(getName(), o.getName());
            if (i == 0) {
                i = getVersion().compareTo(o.getVersion());
            }
            return i;
View Full Code Here

            return versionRange;
        }

        public int compareTo(PackageRequirement o) {
            Collator collator = Collator.getInstance();
            int i = collator.compare(getName(), o.getName());
            if (i == 0) {
                i = getVersionRange().toString().compareTo(o.getVersionRange().toString());
            }
            return i;
        }
View Full Code Here

    public void testCollator_GetInstance() {
        Collator coll = Collator.getInstance();
        Object obj1 = "a";
        Object obj2 = "b";
        assertEquals(-1, coll.compare(obj1, obj2));

        Collator.getInstance();
        assertFalse(coll.equals("A", "\uFF21"));
    }
View Full Code Here

    final String field = fieldname.intern();
    final String[] index = FieldCache.DEFAULT.getStrings (reader, field);
    return new ScoreDocComparator() {

      public final int compare (final ScoreDoc i, final ScoreDoc j) {
        return collator.compare (index[i.doc], index[j.doc]);
      }

      public Comparable sortValue (final ScoreDoc i) {
        return index[i.doc];
      }
View Full Code Here

    for (int i = 0; i < length; i++) {
      if (m2 <= hightValue - lowerValue) {
        if (m1 <= pivot - lowerValue) {
          String name = working.get(m1).getRegistrationAppointment().getRegistration().getStudent().getName();
          String name2 = working.get(m2).getRegistrationAppointment().getRegistration().getStudent().getName();
          if (collator.compare(name, name2) > 0) {
            presencesList.set(i + lowerValue, working.get(m2++));
          } else {
            if (name.equals(name2)){
              GDDate date = new GDDate(working.get(m1).getDate());
              GDDate date2 = new GDDate(working.get(m2).getDate());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.