org.objectweb.jonas.webapp.jonasadmin.common.BeanComparator Class Reference

List of all members.

Public Member Functions

 BeanComparator ()
 BeanComparator (String[] p_Orders)
int compare (Object p_O1, Object p_O2)
boolean equals (Object p_Obj)

Static Public Member Functions

int compareNull (Object p_O1, Object p_O2)
int compareString (String p_S1, String p_S2)

Protected Member Functions

int compareDefault (Object p_O1, Object p_O2)
int compareOrder (Object p_O1, Object p_O2)

Detailed Description

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

Definition at line 40 of file BeanComparator.java.


Constructor & Destructor Documentation

org.objectweb.jonas.webapp.jonasadmin.common.BeanComparator.BeanComparator  ) 
 

Comparator by default (use the toString() methods).

Definition at line 51 of file BeanComparator.java.

org.objectweb.jonas.webapp.jonasadmin.common.BeanComparator.BeanComparator String[]  p_Orders  ) 
 

Comparator in order of the properties.

Parameters:
p_Orders A array of the names of the properties

Definition at line 60 of file BeanComparator.java.


Member Function Documentation

int org.objectweb.jonas.webapp.jonasadmin.common.BeanComparator.compare Object  p_O1,
Object  p_O2
 

Compare two beans instances.

Parameters:
p_O1 The first bean to compare
p_O2 The second bean to compare
Returns:
0 if equals, < 0 if first bean lower than second bean, > 0 if first bean upper than second bean.

Definition at line 73 of file BeanComparator.java.

References org.objectweb.jonas.webapp.jonasadmin.common.BeanComparator.compareDefault(), and org.objectweb.jonas.webapp.jonasadmin.common.BeanComparator.compareOrder().

Referenced by org.objectweb.jonas.webapp.jonasadmin.common.BeanComparator.equals().

Here is the call graph for this function:

int org.objectweb.jonas.webapp.jonasadmin.common.BeanComparator.compareDefault Object  p_O1,
Object  p_O2
[protected]
 

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
p_O2 The second bean to compare
Returns:
0 if equals, < 0 if first bean lower than second bean, > 0 if first bean upper than second bean.

Definition at line 147 of file BeanComparator.java.

References org.objectweb.jonas.webapp.jonasadmin.common.BeanComparator.compareNull(), and org.objectweb.jonas.webapp.jonasadmin.common.BeanComparator.compareString().

Referenced by org.objectweb.jonas.webapp.jonasadmin.common.BeanComparator.compare().

Here is the call graph for this function:

int org.objectweb.jonas.webapp.jonasadmin.common.BeanComparator.compareNull Object  p_O1,
Object  p_O2
[static]
 

Compare the null of two objects.

Parameters:
p_O1 The first object to compare
p_O2 The second object to compare
Returns:
0 if the two are null or the two not null, < 0 if second object is null, > 0 if first object is null.

Definition at line 100 of file BeanComparator.java.

Referenced by org.objectweb.jonas.webapp.jonasadmin.common.BeanComparator.compareDefault(), org.objectweb.jonas.webapp.jonasadmin.common.BeanComparator.compareOrder(), and org.objectweb.jonas.webapp.jonasadmin.common.BeanComparator.compareString().

int org.objectweb.jonas.webapp.jonasadmin.common.BeanComparator.compareOrder Object  p_O1,
Object  p_O2
[protected]
 

Compare the beans with the properties in order given. Used when order is known.

Parameters:
p_O1 The first bean to compare
p_O2 The second bean to compare
Returns:
0 if equals, < 0 if first bean lower than second bean, > 0 if first bean upper than second bean.

Definition at line 163 of file BeanComparator.java.

References org.objectweb.jonas.webapp.jonasadmin.common.BeanComparator.compareNull(), and org.objectweb.jonas.webapp.jonasadmin.common.BeanComparator.compareString().

Referenced by org.objectweb.jonas.webapp.jonasadmin.common.BeanComparator.compare().

Here is the call graph for this function:

int org.objectweb.jonas.webapp.jonasadmin.common.BeanComparator.compareString String  p_S1,
String  p_S2
[static]
 

Compare two strings with the ignore case but if is identical, compare normaly with case.

Parameters:
p_O1 The first string to compare
p_O2 The second string to compare
Returns:
0 if equals, < 0 if first string lower than second string, > 0 if first string upper than second string.

Definition at line 121 of file BeanComparator.java.

References org.objectweb.jonas.webapp.jonasadmin.common.BeanComparator.compareNull().

Referenced by org.objectweb.jonas.webapp.jonasadmin.common.BeanComparator.compareDefault(), and org.objectweb.jonas.webapp.jonasadmin.common.BeanComparator.compareOrder().

Here is the call graph for this function:

boolean org.objectweb.jonas.webapp.jonasadmin.common.BeanComparator.equals Object  p_Obj  ) 
 

Indentical bean.

Parameters:
p_Obj The bean to compare.
Returns:
True if identical.

Definition at line 86 of file BeanComparator.java.

References org.objectweb.jonas.webapp.jonasadmin.common.BeanComparator.compare().

Here is the call graph for this function:


The documentation for this class was generated from the following file:
Generated on Tue Feb 15 15:08:55 2005 for JOnAS by  doxygen 1.3.9.1