Top Description Fields Methods
org.springframework.core

public Interface Ordered

Known Direct Subinterfaces
org.springframework.core.PriorityOrdered

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.

Authors
Juergen Hoeller, Sam Brannen
Since
07.04.2003
See Also
PriorityOrdered, OrderComparator, org.springframework.core.annotation.Order, org.springframework.core.annotation.AnnotationAwareOrderComparator

Field Summary

Modifier and TypeField and Description
public static final int
HIGHEST_PRECEDENCE

Useful constant for the highest precedence value.

public static final int
LOWEST_PRECEDENCE

Useful constant for the lowest precedence value.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the order value
getOrder
()

Get the order value of this object.

Field Detail

HIGHEST_PRECEDENCEback to summary
public static final int HIGHEST_PRECEDENCE

Useful constant for the highest precedence value.

See Also
java.lang.Integer#MIN_VALUE
LOWEST_PRECEDENCEback to summary
public static final int LOWEST_PRECEDENCE

Useful constant for the lowest precedence value.

See Also
java.lang.Integer#MAX_VALUE

Method Detail

getOrderback to summary
public 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-startup values).

Same order values will result in arbitrary sort positions for the affected objects.

Returns:int

the order value

See Also
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE