Package org.dmfs.jems2.comparator
Class IterableComparator<T>
- java.lang.Object
-
- org.dmfs.jems2.comparator.DelegatingComparator<java.lang.Iterable<? extends T>>
-
- org.dmfs.jems2.comparator.IterableComparator<T>
-
- All Implemented Interfaces:
java.util.Comparator<java.lang.Iterable<? extends T>>
public final class IterableComparator<T> extends DelegatingComparator<java.lang.Iterable<? extends T>>
Comparator forIterables. Elements are compared by the givenComparatorofOptionals. The delegate will receive absentOptionals when the shorterIterablehas run out of elements.Examples
With new
OptionalComparator(naturalOrder)as the delegate[] == [] [1, 2, 3] == [1, 2, 3] [1, 2, 3] < [1, 2, 3, 4] [1, 2, 3] < [1, 2, 4] [1, 2, 3] < [1, 3]
-
-
Constructor Summary
Constructors Constructor Description IterableComparator(java.util.Comparator<? super Optional<? extends T>> delegate)
-
Method Summary
-
Methods inherited from class org.dmfs.jems2.comparator.DelegatingComparator
compare
-
-