public class CaseInsensitiveOrder
- Object
- CaseInsensitiveOrder
ImplementsComparator<String>
A string comparator equivalent to String.CASE_INSENSITIVE_ORDER which isn’t available in Codename One
Constructors
public CaseInsensitiveOrder() |
Methods
public int compare(String s1, String s2) | Compares the two specified objects to determine their relative ordering. |
Inherited methods
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 allathe sign of
compare(a,b)must be the opposite of the sign ofcompare(b,a)for all pairs of (a,b)From
compare(a,b) > 0andcompare(b,c) > 0it must followcompare(a,c) > 0for all possible combinations of(a,b,c)
Parameters
s1String- an
Object. s2String- a second
Objectto compare withobject1.
Returns
an integer 0 if
object1 is greater than object2.Throws
ClassCastException- if objects are not of the correct type.