01: package org.objectweb.jonas.webapp.jonasadmin.jonasmqconnect.util;
02:
03: import java.util.Comparator;
04:
05: public class PropertiesComparator implements Comparator {
06:
07: public int compare(Object obj1, Object obj2) {
08: Property prop1 = (Property) obj1;
09: Property prop2 = (Property) obj2;
10:
11: int iRet = prop1.getName().compareToIgnoreCase(prop2.getName());
12: if (iRet == 0) {
13: iRet = prop1.getValue().compareToIgnoreCase(
14: prop2.getValue());
15: }
16: return iRet;
17: }
18:
19: public boolean equals(Object obj) {
20: if (obj instanceof Property) {
21: return true;
22: }
23: return false;
24: }
25: }
|