T - type of the compared objects.@FunctionalInterface public interface PriorityComparator<T>
Comparable and is used to prioritize between two objects.
The main difference between this interface and Comparable is it is not require to follow
the usual contract between that Comparable.compareTo(Object) and Object.equals(Object). The contract of this interface is: When two objects are equal, they
indicate the same priority, but indicating the same priority does not require that both objects
are equal.| 限定符和类型 | 字段和说明 |
|---|---|
static PriorityComparator<? extends PriorityComparable<Object>> |
FOR_PRIORITY_COMPARABLE_OBJECTS |
| 限定符和类型 | 方法和说明 |
|---|---|
int |
comparePriority(T left,
T right)
Compares two objects for priority.
|
static <T extends PriorityComparable<?>> |
forPriorityComparableObjects() |
static final PriorityComparator<? extends PriorityComparable<Object>> FOR_PRIORITY_COMPARABLE_OBJECTS
int comparePriority(T left, T right)
left - left operand in the comparison by priority.right - left operand in the comparison by priority.static <T extends PriorityComparable<?>> PriorityComparator<T> forPriorityComparableObjects()
Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.