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:
Comparator<T>
A
Comparator which delegates the comparison of two instances to other Comparators 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)
-
Constructor Summary
ConstructorsConstructorDescriptionComposite(Iterable<? extends Comparator<? super T>> delegates) Composite(Comparator<? super T>... delegates) -
Method Summary
Methods inherited from class org.dmfs.jems2.comparator.DelegatingComparator
compareMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
Composite
-
Composite
-