public final class CompositeComparator<T> extends Object implements Comparator<T>
Constructor and Description |
---|
CompositeComparator(Comparator<? super T>... comparators)
Constructs a comparator based on the specified underlying comparators.
|
CompositeComparator(Comparator<? super T> comparator1,
Comparator<? super T> comparator2)
Constructs a comparator based on the specified underlying comparators.
|
CompositeComparator(Comparator<? super T> comparator1,
Comparator<? super T> comparator2,
Comparator<? super T> comparator3)
Constructs a comparator based on the specified underlying comparators.
|
CompositeComparator(List<Comparator<? super T>> comparators)
Constructs a comparator based on the specified underlying comparators.
|
Modifier and Type | Method and Description |
---|---|
int |
compare(T o1,
T o2) |
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
public CompositeComparator(Comparator<? super T>... comparators)
comparators
- the underlying comparatorspublic CompositeComparator(Comparator<? super T> comparator1, Comparator<? super T> comparator2)
comparator1
- the first underlying comparatorscomparator2
- the second underlying comparatorspublic CompositeComparator(Comparator<? super T> comparator1, Comparator<? super T> comparator2, Comparator<? super T> comparator3)
comparator1
- the first underlying comparatorscomparator2
- the second underlying comparatorscomparator3
- the third underlying comparatorspublic CompositeComparator(List<Comparator<? super T>> comparators)
comparators
- the underlying comparatorsCopyright © 2024. All rights reserved.