Code example for Collator

Methods: setStrength

0
    /** 
     * Construct a PathComparator. 
     */ 
    public PathComparator() { 
        collator = Collator.getInstance();
        collator.setStrength(Collator.PRIMARY);
    } 
     
    /** 
     * Compare two UML elements names, ignoring case, using names from the path 
     * as tie breakers.  As a convenience, we also compare simple strings using 
     * the same primary strength collator. 
     *  
     * @param o1 first model element 
     * @param o2 second model element 
     * @return -1, 0, 1 
     * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object) 
     */ 
    public int compare(Object o1, Object o2) {
        if (o1 == null) {
            if (o2 == null) {