T
- 被排序元素类型public class IndexedComparator<T> extends Object implements Comparator<T>
Constructor and Description |
---|
IndexedComparator(boolean atEndIfMiss,
T... objs)
构造
|
IndexedComparator(T... objs)
构造
|
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 IndexedComparator(T... objs)
objs
- 参与排序的数组,数组的元素位置决定了对象的排序先后public IndexedComparator(boolean atEndIfMiss, T... objs)
atEndIfMiss
- 如果不在列表中是否排在后边objs
- 参与排序的数组,数组的元素位置决定了对象的排序先后public int compare(T o1, T o2)
compare
in interface Comparator<T>
Copyright © 2021. All rights reserved.