|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Comparator
An interface defining a comparator which compares two objects (in an
implementation-defined manner) to see if they match or what their relative
sort order is. The application implements this interface to compare two
candidate objects. The return value must indicate the ordering of the two
records.
The compare method is called by PersistableManager
to sort the
results of a search.
PersistableManager.find(Class, Filter, Comparator)
,
Filter
Field Summary | |
---|---|
static int |
EQUIVALENT
EQUIVALENT means that in terms of search or sort order, the two objects are the same. |
static int |
FOLLOWS
FOLLOWS means that the left (first parameter) object follows the right (second parameter) object in terms of search or sort order. The value of FOLLOWS is 1. |
static int |
PRECEDES
PRECEDES means that the left (first parameter) object precedes the right (second parameter) object in terms of search or sort order. The value of PRECEDES is -1. |
Method Summary | |
---|---|
int |
compare(Persistable o1,
Persistable o2)
Returns Comparator.PRECEDES if o1 precedes
o2 in sort order, or Comparator.FOLLOWS if
o1 follows o2 in sort order, or
Comparator.EQUIVALENT if o1 and o2
are equivalent in terms of sort order. |
Field Detail |
---|
static final int EQUIVALENT
static final int FOLLOWS
static final int PRECEDES
Method Detail |
---|
int compare(Persistable o1, Persistable o2)
Comparator.PRECEDES
if o1
precedes
o2
in sort order, or Comparator.FOLLOWS
if
o1
follows o2
in sort order, or
Comparator.EQUIVALENT
if o1
and o2
are equivalent in terms of sort order.
o1
- The first object for comparison.o2
- The second object for comparison.
Comparator.PRECEDES
if o1
precedes
o2
in sort order, or Comparator.FOLLOWS
if o1
follows o2
in sort order, or
Comparator.EQUIVALENT
if o1
and
o2
are equivalent in terms of sort order.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |