Package java.text

Examples of java.text.Collator.compare()


      } 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


        final Collator collator = Collator.getInstance(new Locale("is"));
        Collections.sort(list, new Comparator<RoomTypeDto>() {
            @Override
            public int compare(RoomTypeDto o1, RoomTypeDto o2) {
                return collator.compare(o1.title, o2.title);
            }
        });
        return list;
    }
}
View Full Code Here

        if ( o1.included && !o2.included ) {
          return -1;
        } else if ( !o1.included && o2.included ) {
          return 1;
        } else {
          return collator.compare(o1.title, o2.title);
        }
      }
      });
      return extras;
    }
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

    }

    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

                    // a la ClassCache, so we aren't trying to outsmart ourselves
                    // with a caching mechanism for now.
                    Collator collator = Collator.getInstance(cx.getLocale());
                    collator.setStrength(Collator.IDENTICAL);
                    collator.setDecomposition(Collator.CANONICAL_DECOMPOSITION);
                    return ScriptRuntime.wrapNumber(collator.compare(
                            ScriptRuntime.toString(thisObj),
                            ScriptRuntime.toString(args, 0)));
                }
              case Id_toLocaleLowerCase:
                {
View Full Code Here

        final int cmp;
        if(arglen == 3) {
            Item thirdItem = argv.getItem(2);
            String collation = thirdItem.stringValue();
            Collator collator = CollationUtils.resolve(collation, dynEnv.getStaticContext());
            cmp = collator.compare(comparand1, comparand2);
        } else {
            cmp = comparand1.compareTo(comparand2);
        }
        return cmp == 0 ? XInteger.valueOf(0) : (cmp > 0 ? XInteger.valueOf(1)
                : XInteger.valueOf(-1));
View Full Code Here

        for (int i = 1; i < tableItems.length; i++) {
            String value1 = tableItems[i].getText(columnIndex);
            for (int j = 0; j < i; j++) {
                String value2 = tableItems[j].getText(columnIndex);
                boolean notSorted = false;
                if (direction == SWT.UP && collator.compare(value1, value2) > 0) {
                    notSorted = true;
                }
                if (direction == SWT.DOWN && collator.compare(value1, value2) < 0) {
                    notSorted = true;
                }
View Full Code Here

                String value2 = tableItems[j].getText(columnIndex);
                boolean notSorted = false;
                if (direction == SWT.UP && collator.compare(value1, value2) > 0) {
                    notSorted = true;
                }
                if (direction == SWT.DOWN && collator.compare(value1, value2) < 0) {
                    notSorted = true;
                }
                if (notSorted) {
                    String[] values = new String[columnNames.length];
                    for (int col = 0; col < columnNames.length; ++col) {
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

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.