Package com.ibm.icu.impl
Class MultiComparator<T>
- java.lang.Object
-
- com.ibm.icu.impl.MultiComparator<T>
-
- All Implemented Interfaces:
Comparator<T>
public class MultiComparator<T> extends Object implements Comparator<T>
TODO: Move to com.ibm.icu.dev.somewhere. 2015-sep-03: This is used there, and also in CLDR and in UnicodeTools.
-
-
Constructor Summary
Constructors Constructor Description MultiComparator(Comparator<T>... comparators)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompare(T arg0, T arg1)Compares the two specified objects to determine their relative ordering.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Comparator
equals
-
-
-
-
Constructor Detail
-
MultiComparator
public MultiComparator(Comparator<T>... comparators)
-
-
Method Detail
-
compare
public int compare(T arg0, T arg1)
Description copied from interface:ComparatorCompares the two specified objects to determine their relative ordering. The ordering implied by the return value of this method for all possible pairs of(lhs, rhs)should form an equivalence relation. This means thatcompare(a,a)returns zero for alla- the 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)
- Specified by:
comparein interfaceComparator<T>- Parameters:
arg0- anObject.arg1- a secondObjectto compare withlhs.- Returns:
- an integer < 0 if
lhsis less thanrhs, 0 if they are equal, and > 0 iflhsis greater thanrhs.
-
-