|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.ow2.jonas.webapp.jonasadmin.common.BeanComparator
public class BeanComparator
BeanComparator is a comparator for beans.
It's used to compare a bean with its own properties or with its own string value
(return by the toString()
method).
Constructor Summary | |
---|---|
BeanComparator()
Comparator by default (use the toString() methods). |
|
BeanComparator(String[] p_Orders)
Comparator in order of the properties. |
Method Summary | |
---|---|
int |
compare(Object p_O1,
Object p_O2)
Compare two beans instances. |
protected int |
compareDefault(Object p_O1,
Object p_O2)
Compare the beans like a string (used the toString() method of the object). |
static int |
compareNull(Object p_O1,
Object p_O2)
Compare the null of two objects. |
protected int |
compareOrder(Object p_O1,
Object p_O2)
Compare the beans with the properties in order given. |
static int |
compareString(String p_S1,
String p_S2)
Compare two strings with the ignore case but if is identical, compare normaly with case. |
boolean |
equals(Object p_Obj)
Indentical bean. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BeanComparator()
toString()
methods).
public BeanComparator(String[] p_Orders)
p_Orders
- A array of the names of the propertiesMethod Detail |
---|
public int compare(Object p_O1, Object p_O2)
compare
in interface Comparator
p_O1
- The first bean to comparep_O2
- The second bean to compare
public boolean equals(Object p_Obj)
equals
in interface Comparator
equals
in class Object
p_Obj
- The bean to compare.
public static int compareNull(Object p_O1, Object p_O2)
p_O1
- The first object to comparep_O2
- The second object to compare
public static int compareString(String p_S1, String p_S2)
p_O1
- The first string to comparep_O2
- The second string to compare
protected int compareDefault(Object p_O1, Object p_O2)
toString()
method of the object).
Used when order is unknown.
p_O1
- The first bean to comparep_O2
- The second bean to compare
protected int compareOrder(Object p_O1, Object p_O2)
p_O1
- The first bean to comparep_O2
- The second bean to compare
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |