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.
| Modifier and Type | Field and Description |
|---|---|
static int |
HIGHEST_PRECEDENCE
Useful constant for the highest precedence value.
|
static int |
LOWEST_PRECEDENCE
Useful constant for the lowest precedence value.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getOrder()
Get the order value of this object.
|
static final int HIGHEST_PRECEDENCE
Integer.MIN_VALUE,
Constant Field Valuesstatic final int LOWEST_PRECEDENCE
Integer.MAX_VALUE,
Constant Field Valuesint getOrder()
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-startup values).
Same order values will result in arbitrary sort positions for the affected objects.
HIGHEST_PRECEDENCE,
LOWEST_PRECEDENCECopyright © 2018 Ctrip, Inc.. All rights reserved.