Package java.text

Examples of java.text.Collator.compare()


    }

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

    public static void setNCNameValidator (DatatypeValidator dv) {
        // make a string validator for NCName
        if ( fgStrValidator == null) {
View Full Code Here


     */
    public int collate(String source) {
        if (source == null)
            data_RaiseNilOperandExcpt();
        Collator myCollator = Collator.getInstance();
        return myCollator.compare(source, theString.toString());
    }

    /**
     * Collate - check how the supplied StringBuffer collates with this string
     * <P>
 
View Full Code Here

     */
    public int collate(String source) {
        if (source == null)
            data_RaiseNilOperandExcpt();
        Collator myCollator = Collator.getInstance();
        return myCollator.compare(source, theString.toString());
    }

    /**
     * Collate - check how the supplied StringBuffer collates with this string
     * <P>
 
View Full Code Here

     */
    public int collate(String source) {
        if (source == null)
            data_RaiseNilOperandExcpt();
        Collator myCollator = Collator.getInstance();
        return myCollator.compare(source, theString.toString());
    }

    /**
     * Collate - check how the supplied StringBuffer collates with this string
     * <P>
 
View Full Code Here

          return 0;
        if (v1==null)
          return 1;
        if(v2==null)
          return -1;
        return -collator.compare(v1,v2);
      }
    };
  }

View Full Code Here

                    }
                    Collections.sort(collections, new Comparator() {
                        public int compare(Object arg0, Object arg1) {
                            Collator comp = Collator.getInstance(Locale.US);
                            comp.setStrength(Collator.PRIMARY);
                            return comp.compare(((Collection) arg0).getName().toLowerCase(), ((Collection) arg1).getName().toLowerCase() );
                        }
                    });
                    this.collection.setCollections(collections);
                    this.isCollectionsInit = true;
                    return this.collection.getCollections();
View Full Code Here

                    }
                    Collections.sort(folders, new Comparator() {
                        public int compare(Object arg0, Object arg1) {
                            Collator comp = Collator.getInstance(Locale.US);
                            comp.setStrength(Collator.PRIMARY);
                            return comp.compare(((Folder) arg0).getName().toLowerCase(), ((Folder) arg1).getName().toLowerCase() );
                        }
                    });
                    this.collection.setFolders(folders);
                    this.isFoldersInit = true;
                    return this.collection.getFolders();
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

                    }
                    Collections.sort(files, new Comparator() {
                        public int compare(Object arg0, Object arg1) {
                            Collator comp = Collator.getInstance(Locale.US);
                            comp.setStrength(Collator.PRIMARY);
                            return comp.compare(((StoredFile) arg0).getName().toLowerCase(), ((StoredFile) arg1).getName().toLowerCase() );
                        }
                    });
                    folder.setStoredFiles(files);
                   
                    this.isStoredFilesInit = true;
View Full Code Here

                    if (!caseSensitive)
                    {
                        fk1Name = (fk1Name != null ? fk1Name.toLowerCase() : null);
                        fk2Name = (fk2Name != null ? fk2Name.toLowerCase() : null);
                    }
                    return collator.compare(fk1Name, fk2Name);
                }
            });
        }
    }
   
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.