public class ComparatorChain<T> extends Object implements Comparator<T>
Comparator
s.Modifier and Type | Field and Description |
---|---|
protected Comparator<T>[] |
comparators |
Constructor and Description |
---|
ComparatorChain(Comparator<T>... cs)
Takes a sequence of comparators, ranging rom the "coarsest" to "finest".
|
Modifier and Type | Method and Description |
---|---|
int |
compare(T o1,
T o2)
Tries the comparators from the first to the last.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
protected Comparator<T>[] comparators
@SafeVarargs public ComparatorChain(Comparator<T>... cs)
public int compare(T o1, T o2)
!=0
, or the very last.compare
in interface Comparator<T>
see also the complete user documentation .