| java.lang.Object org.objectweb.jonas.webapp.jonasadmin.common.BeanComparator
BeanComparator | public class BeanComparator implements Comparator(Code) | | 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).
author: Michel-Ange ANTON |
Constructor Summary | |
public | BeanComparator() Comparator by default (use the toString() methods). | public | BeanComparator(String[] p_Orders) Comparator in order of the properties. |
Method Summary | |
public 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). | public 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. | public static int | compareString(String p_S1, String p_S2) Compare two strings with the ignore case
but if is identical, compare normaly with case. | public boolean | equals(Object p_Obj) Indentical bean.
Parameters: p_Obj - The bean to compare. |
BeanComparator | public BeanComparator()(Code) | | Comparator by default (use the toString() methods).
|
BeanComparator | public BeanComparator(String[] p_Orders)(Code) | | Comparator in order of the properties.
Parameters: p_Orders - A array of the names of the properties |
compare | public int compare(Object p_O1, Object p_O2)(Code) | | Compare two beans instances.
Parameters: p_O1 - The first bean to compare Parameters: p_O2 - The second bean to compare 0 if equals, < 0 if first bean lower than second bean, > 0 if first bean upper than second bean. |
compareDefault | protected int compareDefault(Object p_O1, Object p_O2)(Code) | | Compare the beans like a string (used the toString() method of the object).
Used when order is unknown.
Parameters: p_O1 - The first bean to compare Parameters: p_O2 - The second bean to compare 0 if equals, < 0 if first bean lower than second bean, > 0 if first bean upper than second bean. |
compareNull | public static int compareNull(Object p_O1, Object p_O2)(Code) | | Compare the null of two objects.
Parameters: p_O1 - The first object to compare Parameters: p_O2 - The second object to compare 0 if the two are null or the two not null, < 0 if second object is null, > 0 if first object is null. |
compareOrder | protected int compareOrder(Object p_O1, Object p_O2)(Code) | | Compare the beans with the properties in order given.
Used when order is known.
Parameters: p_O1 - The first bean to compare Parameters: p_O2 - The second bean to compare 0 if equals, < 0 if first bean lower than second bean, > 0 if first bean upper than second bean. |
compareString | public static int compareString(String p_S1, String p_S2)(Code) | | Compare two strings with the ignore case
but if is identical, compare normaly with case.
Parameters: p_O1 - The first string to compare Parameters: p_O2 - The second string to compare 0 if equals, < 0 if first string lower than second string, > 0 if first string upper than second string. |
equals | public boolean equals(Object p_Obj)(Code) | | Indentical bean.
Parameters: p_Obj - The bean to compare. True if identical. |
|
|