接口 Ordered
- 所有已知子接口:
PriorityOrdered
- 所有已知实现类:
OrderedSupport
public interface Ordered
Ordered is an interface that can be implemented by objects that
should be orderable, for example in a Collection.
The actual order can be interpreted as prioritization,
with the first object (with the lowest order value) having the highest
priority.
Note that there is also a priority marker for this interface:
PriorityOrdered. Consult the Javadoc for PriorityOrdered for
details on how PriorityOrdered objects are ordered relative to
plain Ordered objects.
Consult the Javadoc for OrderComparator for details on the
sort semantics for non-ordered objects.
- 作者:
- Juergen Hoeller, Sam Brannen, TODAY 2018-11-07 13:08
- 另请参阅:
-
字段概要
字段修饰符和类型字段说明static final intUseful constant for the highest precedence value.static final intUseful constant for the lowest precedence value. -
方法概要
-
字段详细资料
-
HIGHEST_PRECEDENCE
static final int HIGHEST_PRECEDENCEUseful constant for the highest precedence value.- 另请参阅:
-
LOWEST_PRECEDENCE
static final int LOWEST_PRECEDENCEUseful constant for the lowest precedence value.- 另请参阅:
-
-
方法详细资料
-
getOrder
int getOrder()Get the order value of this object.Higher values are interpreted as lower priority. As a consequence, the object with the lowest value has the highest priority (somewhat analogous to Servlet
load-on-startupvalues).Same order values will result in arbitrary sort positions for the affected objects.
- 返回:
- the order value
- 另请参阅:
-