1 11 package com.ibm.icu.impl; 12 import com.ibm.icu.util.TimeZone; 13 import java.util.Date ; 14 15 33 public class TimeZoneAdapter extends java.util.TimeZone { 34 35 static final long serialVersionUID = -2040072218820018557L; 37 38 42 private TimeZone zone; 43 44 48 public static java.util.TimeZone wrap(com.ibm.icu.util.TimeZone tz) { 49 return new TimeZoneAdapter(tz); 50 } 51 52 55 public com.ibm.icu.util.TimeZone unwrap() { 56 return zone; 57 } 58 59 65 public TimeZoneAdapter(TimeZone zone) { 66 this.zone = zone; 67 super.setID(zone.getID()); 68 } 69 70 73 public void setID(String ID) { 74 super.setID(ID); 75 zone.setID(ID); 76 } 77 78 81 public boolean hasSameRules(java.util.TimeZone other) { 82 return other instanceof TimeZoneAdapter && 83 zone.hasSameRules(((TimeZoneAdapter)other).zone); 84 } 85 86 89 public int getOffset(int era, int year, int month, int day, int dayOfWeek, 90 int millis) { 91 return zone.getOffset(era, year, month, day, dayOfWeek, millis); 92 } 93 94 97 public int getRawOffset() { 98 return zone.getRawOffset(); 99 } 100 101 104 public void setRawOffset(int offsetMillis) { 105 zone.setRawOffset(offsetMillis); 106 } 107 108 111 public boolean useDaylightTime() { 112 return zone.useDaylightTime(); 113 } 114 115 118 public boolean inDaylightTime(Date date) { 119 return zone.inDaylightTime(date); 120 } 121 122 125 public Object clone() { 126 return new TimeZoneAdapter((TimeZone)zone.clone()); 127 } 128 129 132 public synchronized int hashCode() { 133 return zone.hashCode(); 134 } 135 136 139 public boolean equals(Object obj) { 140 if (obj instanceof TimeZoneAdapter) { 141 obj = ((TimeZoneAdapter) obj).zone; 142 } 143 return zone.equals(obj); 144 } 145 146 150 public String toString() { 151 return "TimeZoneAdapter: " + zone.toString(); 152 } 153 } 154 | Popular Tags |