1 package org.roller.util; 2 import java.util.TimeZone ; 3 import java.util.Comparator ; 4 import java.io.Serializable ; 5 6 public class TimeZoneComparator implements Comparator , Serializable  7 { 8 public int compare(Object obj1, Object obj2) 9 { 10 if (obj1 instanceof TimeZone && obj2 instanceof TimeZone ) 11 { 12 TimeZone zone1 = (TimeZone )obj1; 13 TimeZone zone2 = (TimeZone )obj2; 14 int compName = zone1.getDisplayName().compareTo(zone2.getDisplayName()); 15 if (compName == 0) 16 { 17 return zone1.getID().compareTo(zone2.getID()); 18 } 19 return compName; 20 } 21 return 0; 22 } 23 24 34 } | Popular Tags |