|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--com.generationjava.compare.BeanComparator
A Comparator for JavaBeans. Provide the name of the property to be compared with, and BeanComparator will deal with finding the property and comparing on it using ObjectComparator. Some examples are: "person" -> getPerson() "person.name" -> getPerson().getName() "person.addressMap.fred" -> getPerson().getAddressMap().get("fred") "person.phone[3]" -> getPerson().getPhone()[3] and getPerson().getPhone().get(3) (array and List)
| Constructor Summary | |
BeanComparator(java.lang.String attrib)
|
|
| Method Summary | |
boolean |
caching()
Is caching on? |
boolean |
caching(boolean b)
Turn on caching. |
int |
compare(java.lang.Object o1,
java.lang.Object o2)
|
static BeanComparator |
getInstance(java.lang.String attrib)
Get a BeanComparator for the specified property. |
void |
precompile(java.util.Collection col)
Do a Schwartzian transform precompile of all the values. |
void |
setComparator(java.util.Comparator comp)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.util.Comparator |
equals |
| Constructor Detail |
public BeanComparator(java.lang.String attrib)
| Method Detail |
public static BeanComparator getInstance(java.lang.String attrib)
public void setComparator(java.util.Comparator comp)
public void precompile(java.util.Collection col)
public boolean caching(boolean b)
public boolean caching()
public int compare(java.lang.Object o1,
java.lang.Object o2)
compare in interface java.util.Comparator
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||