public final class Crane4jGlobalSorter extends Object implements Comparator<Object>
| 限定符和类型 | 字段和说明 |
|---|---|
static Crane4jGlobalSorter |
INSTANCE
Default global singleton.
|
List<Function<Object,Integer>> |
keyExtractors
key extractor chain.
|
| 构造器和说明 |
|---|
Crane4jGlobalSorter() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addCompareValueExtractor(Function<Object,Integer> compareValueExtractor)
Add comparator.
|
static <T> Comparator<T> |
comparator()
Get comparator instance.
|
int |
compare(Object o1,
Object o2)
Compare instance.
|
int |
getSortValue(Object target,
int defVal)
Get sort value.
|
public static final Crane4jGlobalSorter INSTANCE
public static <T> Comparator<T> comparator()
public void addCompareValueExtractor(Function<Object,Integer> compareValueExtractor)
compareValueExtractor - instancepublic int compare(Object o1, Object o2)
compare 在接口中 Comparator<Object>o1 - the first object to be compared.o2 - the second object to be compared.NullPointerException - if an argument is null and this
comparator does not permit null argumentsClassCastException - if the arguments' types prevent them from
being compared by this comparator.public int getSortValue(Object target, int defVal)
target - targetdefVal - default value if cannot extract sort value from targetCopyright © 2024. All rights reserved.