Class CaseInsensitiveOrder

java.lang.Object
com.codename1.util.CaseInsensitiveOrder
All Implemented Interfaces:
Comparator<String>

public class CaseInsensitiveOrder extends Object implements Comparator<String>
A string comparator equivalent to String.CASE_INSENSITIVE_ORDER which isn't available in Codename One
  • Constructor Details

    • CaseInsensitiveOrder

      public CaseInsensitiveOrder()
  • Method Details

    • compare

      public int compare(String s1, String s2)

      Compares the two specified objects to determine their relative ordering. The ordering implied by the return value of this method for all possible pairs of (object1, object2) should form an equivalence relation. This means that

      • compare(a,a) returns zero for all a

      • the sign of compare(a,b) must be the opposite of the sign of compare(b,a) for all pairs of (a,b)

      • From compare(a,b) > 0 and compare(b,c) > 0 it must follow compare(a,c) > 0 for all possible combinations of (a,b,c)

      Parameters
      • object1: an Object.

      • object2: a second Object to compare with object1.

      Returns

      an integer 0 if object1 is greater than object2.

      Throws
      • ClassCastException: if objects are not of the correct type.
      Specified by:
      compare in interface Comparator<String>