|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.commons.beanutils.BeanComparator
Allows you to pass the name of a method in and compare two beans.
Field Summary | |
private java.util.Comparator |
comparator
|
private java.lang.String |
property
|
Constructor Summary | |
BeanComparator(java.lang.String property)
Creates a Bean comparator that calls the property specified on the objects. |
|
BeanComparator(java.lang.String property,
java.util.Comparator comparator)
Creates a comparator that compares objects based on the method name of two JavaBeans. |
Method Summary | |
int |
compare(java.lang.Object o1,
java.lang.Object o2)
Compare two JavaBeans by their shared property. |
java.util.Comparator |
getComparator()
Gets the Comparator being used to compare beans. |
java.lang.String |
getProperty()
Gets the property attribute of the BeanComparator |
void |
setProperty(java.lang.String property)
Sets the method to be called to compare two JavaBeans |
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 |
Field Detail |
private java.lang.String property
private java.util.Comparator comparator
Constructor Detail |
public BeanComparator(java.lang.String property)
property
- String name of bean propertypublic BeanComparator(java.lang.String property, java.util.Comparator comparator)
property
- String method name to call to comparecomparator
- Comparator to call afterwords!Method Detail |
public void setProperty(java.lang.String property)
property
- String method name to call to comparepublic java.lang.String getProperty()
public java.util.Comparator getComparator()
public int compare(java.lang.Object o1, java.lang.Object o2)
compare
in interface java.util.Comparator
o1
- Object The first bean to get data from to compare againsto2
- Object The second bean to get data from to compare
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |