1 18 package org.apache.roller.util; 19 import java.util.TimeZone ; 20 import java.util.Comparator ; 21 import java.io.Serializable ; 22 23 public class TimeZoneComparator implements Comparator , Serializable  24 { 25 public int compare(Object obj1, Object obj2) 26 { 27 if (obj1 instanceof TimeZone && obj2 instanceof TimeZone ) 28 { 29 TimeZone zone1 = (TimeZone )obj1; 30 TimeZone zone2 = (TimeZone )obj2; 31 int compName = zone1.getDisplayName().compareTo(zone2.getDisplayName()); 32 if (compName == 0) 33 { 34 return zone1.getID().compareTo(zone2.getID()); 35 } 36 return compName; 37 } 38 return 0; 39 } 40 41 51 } | Popular Tags |