public class DelegatingComparator extends Object implements Comparator
Constructor and Description |
---|
DelegatingComparator(Comparator comparator1,
Comparator comparator2)
Constructs an instace of this comparator setting the first
(top-priority) comparator and second (lower-priority) comparator.
|
Modifier and Type | Method and Description |
---|---|
int |
compare(Object o1,
Object o2)
Compares two given objects.
|
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 DelegatingComparator(Comparator comparator1, Comparator comparator2)
comparator1
- comparatorcomparator2
- comparatorpublic int compare(Object o1, Object o2)
comparator1
first and returns
the result of comparison if not 0. In case of 0, it continues and
returns the result of comparison using comparator2
.compare
in interface Comparator
o1
- object to compareo2
- object to compareCopyright © 2002-2017 Atlassian. All Rights Reserved.