Package org.aoju.bus.core.compare
Class IndexedCompare<T>
java.lang.Object
org.aoju.bus.core.compare.IndexedCompare<T>
- Type Parameters:
T- 被排序元素类型
- All Implemented Interfaces:
Comparator<T>
按照数组的顺序正序排列,数组的元素位置决定了对象的排序先后 如果参与排序的元素并不在数组中,则排序在前
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Constructor Summary
ConstructorsConstructorDescriptionIndexedCompare(boolean atEndIfMiss, T... object) 构造IndexedCompare(T... object) 构造 -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
IndexedCompare
-
IndexedCompare
构造- Parameters:
atEndIfMiss- 如果不在列表中是否排在后边object- 参与排序的数组,数组的元素位置决定了对象的排序先后
-
-
Method Details
-
compare
- Specified by:
comparein interfaceComparator<T>
-