|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--inonit.domain.game.card.Sort
Allows a set of objects to be sorted into an arbitrary order.
Inner Class Summary | |
static class |
Sort.Action
An action to be taken as the result of comparing two objects during a sort. |
static interface |
Sort.Order
A logical ordering for a set of objects. |
Method Summary | |
static Sort.Order |
compose(Sort.Order[] orders)
Returns an Order which is a composite of the given Order s. |
static Sort.Order |
reverse(Sort.Order order)
Returns an Order which is the reverse of the given Order . |
static java.lang.Object[] |
sort(java.lang.Object[] objects,
Sort.Order order)
Sorts an array into the given Sort.Order . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static Sort.Order reverse(Sort.Order order)
Order
which is the reverse of the given Order
.order
- An Order
which will be reversed. Must not be null
.Order
which is the reverse of the given Order
.public static Sort.Order compose(Sort.Order[] orders)
Order
which is a composite of the given Order
s.orders
- a set of Order
s to use to compose this Order
. Must not be null
.
Must not be zero-length.Order
which is composed of the given Order
s, as delegates.
orders[0]
will take precedence; if it returns
EQUAL
from its
compare
method, orders[1]
will govern, and so on.public static java.lang.Object[] sort(java.lang.Object[] objects, Sort.Order order)
Sort.Order
.objects
- The array to sort. Must not be null
. The array is sorted in place -- i.e., the array
given as a parameter will be mutated into the correct order during the execution of this method.order
- The Order
into which to sort objects
. Must not be null
.objects
, for convenience. After this method is executed, it will be in the order specified by
order
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |