Package com.ibm.icu.impl
Class TimeZoneAdapter
- java.lang.Object
-
- java.util.TimeZone
-
- com.ibm.icu.impl.TimeZoneAdapter
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
public class TimeZoneAdapter extends java.util.TimeZone
TimeZoneAdapter
wraps a com.ibm.icu.util.TimeZone subclass and inherits from java.util.TimeZone. Without this class, we would need to 'port' java.util.Date to com.ibm.icu.util as well, so that Date could interoperate properly with the com.ibm.icu.util TimeZone and Calendar classes. With this class, we can use java.util.Date together with com.ibm.icu.util classes.- Since:
- ICU 2.8
- See Also:
TimeZone.setDefault(com.ibm.icu.util.TimeZone)
, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static long
serialVersionUID
private TimeZone
zone
The contained com.ibm.icu.util.TimeZone object.
-
Constructor Summary
Constructors Constructor Description TimeZoneAdapter(TimeZone zone)
Constructs an adapter for a com.ibm.icu.util.TimeZone object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
clone()
Boilerplate API; calls through to wrapped object.boolean
equals(java.lang.Object obj)
Boilerplate API; calls through to wrapped object.int
getOffset(int era, int year, int month, int day, int dayOfWeek, int millis)
TimeZone API; calls through to wrapped time zone.int
getRawOffset()
TimeZone API; calls through to wrapped time zone.int
hashCode()
Boilerplate API; calls through to wrapped object.boolean
hasSameRules(java.util.TimeZone other)
TimeZone API; calls through to wrapped time zone.boolean
inDaylightTime(java.util.Date date)
TimeZone API; calls through to wrapped time zone.void
setID(java.lang.String ID)
TimeZone API; calls through to wrapped time zone.void
setRawOffset(int offsetMillis)
TimeZone API; calls through to wrapped time zone.java.lang.String
toString()
Returns a string representation of this object.TimeZone
unwrap()
Return the java.util.TimeZone wrapped by this object.boolean
useDaylightTime()
TimeZone API; calls through to wrapped time zone.static java.util.TimeZone
wrap(TimeZone tz)
Given a java.util.TimeZone, wrap it in the appropriate adapter subclass of com.ibm.icu.util.TimeZone and return the adapter.
-
-
-
Field Detail
-
serialVersionUID
static final long serialVersionUID
- See Also:
- Constant Field Values
-
zone
private TimeZone zone
The contained com.ibm.icu.util.TimeZone object. Must not be null. We delegate all methods to this object.
-
-
Constructor Detail
-
TimeZoneAdapter
public TimeZoneAdapter(TimeZone zone)
Constructs an adapter for a com.ibm.icu.util.TimeZone object.
-
-
Method Detail
-
wrap
public static java.util.TimeZone wrap(TimeZone tz)
Given a java.util.TimeZone, wrap it in the appropriate adapter subclass of com.ibm.icu.util.TimeZone and return the adapter.
-
unwrap
public TimeZone unwrap()
Return the java.util.TimeZone wrapped by this object.
-
setID
public void setID(java.lang.String ID)
TimeZone API; calls through to wrapped time zone.- Overrides:
setID
in classjava.util.TimeZone
-
hasSameRules
public boolean hasSameRules(java.util.TimeZone other)
TimeZone API; calls through to wrapped time zone.- Overrides:
hasSameRules
in classjava.util.TimeZone
-
getOffset
public int getOffset(int era, int year, int month, int day, int dayOfWeek, int millis)
TimeZone API; calls through to wrapped time zone.- Specified by:
getOffset
in classjava.util.TimeZone
-
getRawOffset
public int getRawOffset()
TimeZone API; calls through to wrapped time zone.- Specified by:
getRawOffset
in classjava.util.TimeZone
-
setRawOffset
public void setRawOffset(int offsetMillis)
TimeZone API; calls through to wrapped time zone.- Specified by:
setRawOffset
in classjava.util.TimeZone
-
useDaylightTime
public boolean useDaylightTime()
TimeZone API; calls through to wrapped time zone.- Specified by:
useDaylightTime
in classjava.util.TimeZone
-
inDaylightTime
public boolean inDaylightTime(java.util.Date date)
TimeZone API; calls through to wrapped time zone.- Specified by:
inDaylightTime
in classjava.util.TimeZone
-
clone
public java.lang.Object clone()
Boilerplate API; calls through to wrapped object.- Overrides:
clone
in classjava.util.TimeZone
-
hashCode
public int hashCode()
Boilerplate API; calls through to wrapped object.- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
Boilerplate API; calls through to wrapped object.- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
Returns a string representation of this object.- Overrides:
toString
in classjava.lang.Object
- Returns:
- a string representation of this object.
-
-