|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.martiansoftware.trivialpersist.helpers.FieldComparator
A simple field-based comparator that can be used in selects.
Field Summary | |
static int |
ORDER_ASCENDING
Instructs the comparator to return results in ASCENDING order |
static int |
ORDER_DESCENDING
Instructs the comparator to return results in DESCENDING order |
Constructor Summary | |
FieldComparator(String fieldName)
Creates a new FieldComparator for the specified field in ascending order |
|
FieldComparator(String fieldName,
int order)
Creates a new FieldComparator for the specified field in the specified order |
Method Summary | |
int |
compare(Object o1,
Object o2)
Performs the field comparison |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Comparator |
equals |
Field Detail |
public static final int ORDER_ASCENDING
public static final int ORDER_DESCENDING
Constructor Detail |
public FieldComparator(String fieldName)
fieldName
- the name of the field to examinepublic FieldComparator(String fieldName, int order)
fieldName
- the name of the field to examineorder
- must be either ORDER_ASCENDING or ORDER_DESCENDINGMethod Detail |
public int compare(Object o1, Object o2)
compare
in interface Comparator
o1
- the first Record to compareo2
- the second Record to compare
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |