Class 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 Detail

      • MultiComparator

        public MultiComparator​(Comparator<T>... comparators)
    • Method Detail

      • compare

        public int compare​(T arg0,
                           T arg1)
        Description copied from interface: Comparator
        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 (lhs, rhs) 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)
        Specified by:
        compare in interface Comparator<T>
        Parameters:
        arg0 - an Object.
        arg1 - a second Object to compare with lhs.
        Returns:
        an integer < 0 if lhs is less than rhs, 0 if they are equal, and > 0 if lhs is greater than rhs.