Package java.text

Examples of java.text.Collator.compare()


            final Collator collator = Collator.getInstance();
           
            Collections.sort(tables, new Comparator() {
                public int compare(Object obj1, Object obj2)
                {
                    return collator.compare(((Table)obj1).getName().toUpperCase(), ((Table)obj2).getName().toUpperCase());
                }
            });
            return tables;
        }
        finally
View Full Code Here


      returnValue = 1;
    }

    Collator c = Collator.getInstance();

    returnValue = c.compare(oneVal.toString(), twoVal.toString());

    return returnValue;
  }
}
View Full Code Here

     * @see java.util.Comparator#compare(Object, Object)
     */
    public int compare( Principal o1, Principal o2 )
    {
        Collator collator = Collator.getInstance();
        return collator.compare( o1.getName(), o2.getName() );
    }

}
View Full Code Here

                retval = ((Comparable) prop1).compareTo(prop2);
            }
            else {
                String string1 = prop1.toString();
                String string2 = prop2.toString();
                retval = collator.compare(string1, string2);
            }

            if (retval != 0) break;
        }
View Full Code Here

    }

    public int compare( String content, String facetValue ){
        Locale    loc       = Locale.getDefault();
        Collator  collator  = Collator.getInstance( loc );
        return collator.compare( content, facetValue );
    }



    /**
 
View Full Code Here

   }
   public int compare( String content, String facetValue ){
      Locale    loc       = Locale.getDefault();
      Collator  collator  = Collator.getInstance( loc );
      return collator.compare( content, facetValue );
   }

   /**
  * Returns a copy of this object.
  */
 
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

                    }
                    items = table.getItems();
                    break;
                   }
                } else {
                    if (collator.compare((order == 1)? value1: value2, (order == 1)? value2: value1) < 0) {
                        String[] values = { items[z].getText(0), items[z].getText(1), items[z].getText(2), items[z].getText(3), items[z].getText(4), items[z].getText(5), items[z].getText(6), items[z].getText(7), items[z].getText(8) };
                        Image[] images = {items[z].getImage(0), items[z].getImage(1), items[z].getImage(2), items[z].getImage(3), items[z].getImage(4), items[z].getImage(5), items[z].getImage(6), items[z].getImage(7), items[z].getImage(8)};
                        Color[] color = { items[z].getForeground(0), items[z].getForeground(1), items[z].getForeground(2), items[z].getForeground(3), items[z].getForeground(4), items[z].getForeground(5), items[z].getForeground(6), items[z].getForeground(7), items[z].getForeground(8)};
                        items[z].dispose();
                        TableItem item = new TableItem(table, SWT.NONE, j);
View Full Code Here

      } else if (is == null) {
        return -1;
      } else if (js == null) {
        return 1;
      } else {
        return collator.compare(is, js);
      }
    }

      public Comparable sortValue (final ScoreDoc i) {
        return index[i.doc];
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

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.