Package java.util

Examples of java.util.Comparator.compare()


    harness.check(c.compare("aBc", "AbC"), 0);
    harness.check(c.compare("", "a") < 0);
    harness.check(c.compare("a", "") > 0);
    harness.check(c.compare("a", "b") < 0);
    harness.check(c.compare("a", "B") < 0);
    harness.check(c.compare("A", "b") < 0);
    harness.check(c.compare("A", "B") < 0);
    harness.check(c.compare("b", "a") > 0);
    harness.check(c.compare("b", "A") > 0);
    harness.check(c.compare("B", "a") > 0);
    harness.check(c.compare("B", "A") > 0);
View Full Code Here


    harness.check(c.compare("", "a") < 0);
    harness.check(c.compare("a", "") > 0);
    harness.check(c.compare("a", "b") < 0);
    harness.check(c.compare("a", "B") < 0);
    harness.check(c.compare("A", "b") < 0);
    harness.check(c.compare("A", "B") < 0);
    harness.check(c.compare("b", "a") > 0);
    harness.check(c.compare("b", "A") > 0);
    harness.check(c.compare("B", "a") > 0);
    harness.check(c.compare("B", "A") > 0);
View Full Code Here

    harness.check(c.compare("a", "") > 0);
    harness.check(c.compare("a", "b") < 0);
    harness.check(c.compare("a", "B") < 0);
    harness.check(c.compare("A", "b") < 0);
    harness.check(c.compare("A", "B") < 0);
    harness.check(c.compare("b", "a") > 0);
    harness.check(c.compare("b", "A") > 0);
    harness.check(c.compare("B", "a") > 0);
    harness.check(c.compare("B", "A") > 0);

    harness.checkPoint("unicode mappings");
View Full Code Here

    harness.check(c.compare("a", "b") < 0);
    harness.check(c.compare("a", "B") < 0);
    harness.check(c.compare("A", "b") < 0);
    harness.check(c.compare("A", "B") < 0);
    harness.check(c.compare("b", "a") > 0);
    harness.check(c.compare("b", "A") > 0);
    harness.check(c.compare("B", "a") > 0);
    harness.check(c.compare("B", "A") > 0);

    harness.checkPoint("unicode mappings");
    // the API (as corrected in 1.4.1) specifies using
View Full Code Here

    harness.check(c.compare("a", "B") < 0);
    harness.check(c.compare("A", "b") < 0);
    harness.check(c.compare("A", "B") < 0);
    harness.check(c.compare("b", "a") > 0);
    harness.check(c.compare("b", "A") > 0);
    harness.check(c.compare("B", "a") > 0);
    harness.check(c.compare("B", "A") > 0);

    harness.checkPoint("unicode mappings");
    // the API (as corrected in 1.4.1) specifies using
    // Character.toUpperCase(), and not String.toUpperCase(), so 1:m case
View Full Code Here

    harness.check(c.compare("A", "b") < 0);
    harness.check(c.compare("A", "B") < 0);
    harness.check(c.compare("b", "a") > 0);
    harness.check(c.compare("b", "A") > 0);
    harness.check(c.compare("B", "a") > 0);
    harness.check(c.compare("B", "A") > 0);

    harness.checkPoint("unicode mappings");
    // the API (as corrected in 1.4.1) specifies using
    // Character.toUpperCase(), and not String.toUpperCase(), so 1:m case
    // mappings are not performed (such as sharp-s to SS).
View Full Code Here

    harness.checkPoint("unicode mappings");
    // the API (as corrected in 1.4.1) specifies using
    // Character.toUpperCase(), and not String.toUpperCase(), so 1:m case
    // mappings are not performed (such as sharp-s to SS).
    harness.check(c.compare("\u00df", "sS") != 0);
    // Likewise, comparisons are locale independent, which affects things
    // like Turkish 'i' and 'I'.
    Locale l = Locale.getDefault();
    Locale.setDefault(new Locale("tr", ""));
    harness.check(c.compare("\u0131I", "i\u0130"), 0);
View Full Code Here

    harness.check(c.compare("\u00df", "sS") != 0);
    // Likewise, comparisons are locale independent, which affects things
    // like Turkish 'i' and 'I'.
    Locale l = Locale.getDefault();
    Locale.setDefault(new Locale("tr", ""));
    harness.check(c.compare("\u0131I", "i\u0130"), 0);
    Locale.setDefault(l);
    harness.check(c.compare("\u0131I", "i\u0130"), 0);

    harness.checkPoint("bad input");
    try
View Full Code Here

    // like Turkish 'i' and 'I'.
    Locale l = Locale.getDefault();
    Locale.setDefault(new Locale("tr", ""));
    harness.check(c.compare("\u0131I", "i\u0130"), 0);
    Locale.setDefault(l);
    harness.check(c.compare("\u0131I", "i\u0130"), 0);

    harness.checkPoint("bad input");
    try
      {
  c.compare(null, "");
View Full Code Here

    harness.check(c.compare("\u0131I", "i\u0130"), 0);

    harness.checkPoint("bad input");
    try
      {
  c.compare(null, "");
  harness.fail("expected NullPointerException");
      }
    catch (NullPointerException e)
      {
  harness.check(true);
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.