T - the type of the objects compared by the comparatorpublic static class ComparatorCompat.Chain<T> extends Object
| Modifier and Type | Method and Description |
|---|---|
Comparator<T> |
comparator()
Returns a chained
Comparator. |
ComparatorCompat.Chain<T> |
reversed()
Reverses the order of comparator.
|
ComparatorCompat.Chain<T> |
thenComparing(Comparator<? super T> other)
Adds the given comparator to the chain.
|
<U extends Comparable<? super U>> |
thenComparing(Function<? super T,? extends U> keyExtractor)
Adds the comparator, that uses a function for extract
a
Comparable sort key, to the chain. |
<U> ComparatorCompat.Chain<T> |
thenComparing(Function<? super T,? extends U> keyExtractor,
Comparator<? super U> keyComparator)
Adds the comparator, that uses a function for extract
a sort key, to the chain.
|
ComparatorCompat.Chain<T> |
thenComparingDouble(ToDoubleFunction<? super T> keyExtractor)
Adds the comparator, that uses a function for extract
a
double sort key, to the chain. |
ComparatorCompat.Chain<T> |
thenComparingInt(ToIntFunction<? super T> keyExtractor)
Adds the comparator, that uses a function for extract
an
int sort key, to the chain. |
ComparatorCompat.Chain<T> |
thenComparingLong(ToLongFunction<? super T> keyExtractor)
Adds the comparator, that uses a function for extract
a
long sort key, to the chain. |
public ComparatorCompat.Chain<T> reversed()
Chain instanceComparatorCompat.reverseOrder()public ComparatorCompat.Chain<T> thenComparing(Comparator<? super T> other)
other - the other comparator to be used when chained
comparator compares two objects that are equalChain instanceComparatorCompat.thenComparing(java.util.Comparator, java.util.Comparator)public <U> ComparatorCompat.Chain<T> thenComparing(Function<? super T,? extends U> keyExtractor, Comparator<? super U> keyComparator)
U - the type of the sort keykeyExtractor - the function that extracts the sort keykeyComparator - the comparator used to compare the sort keyChain instancepublic <U extends Comparable<? super U>> ComparatorCompat.Chain<T> thenComparing(Function<? super T,? extends U> keyExtractor)
Comparable sort key, to the chain.U - the type of the sort keykeyExtractor - the function that extracts the sort keyChain instancepublic ComparatorCompat.Chain<T> thenComparingInt(ToIntFunction<? super T> keyExtractor)
int sort key, to the chain.keyExtractor - the function that extracts the sort keyChain instancepublic ComparatorCompat.Chain<T> thenComparingLong(ToLongFunction<? super T> keyExtractor)
long sort key, to the chain.keyExtractor - the function that extracts the sort keyChain instancepublic ComparatorCompat.Chain<T> thenComparingDouble(ToDoubleFunction<? super T> keyExtractor)
double sort key, to the chain.keyExtractor - the function that extracts the sort keyChain instancepublic Comparator<T> comparator()
Comparator.Copyright © 2017. All rights reserved.