Package org.dmfs.jems2.comparator
Class Composite<T>
- java.lang.Object
-
- org.dmfs.jems2.comparator.DelegatingComparator<T>
-
- org.dmfs.jems2.comparator.Composite<T>
-
- All Implemented Interfaces:
java.util.Comparator<T>
public final class Composite<T> extends DelegatingComparator<T>
AComparatorwhich delegates the comparison of two instances to otherComparators until the first one returns a non-zero result.The result is the same as repeatedly calling "thenComparing" on the
Comparators, i.e. the following two expressions return the same Comparator:comparatorA.thenComparing(comparatorB).thenComparing(comparatorC) new Composite<>(comparatorA, comparatorB, comparatorC)
-
-
Method Summary
-
Methods inherited from class org.dmfs.jems2.comparator.DelegatingComparator
compare
-
-