Package com.ibm.icu.impl
Class TimeZoneAdapter
- java.lang.Object
-
- java.util.TimeZone
-
- com.ibm.icu.impl.TimeZoneAdapter
-
- All Implemented Interfaces:
Serializable,Cloneable
public class TimeZoneAdapter extends TimeZone
TimeZoneAdapterwraps 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
-
-
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 Objectclone()Boilerplate API; calls through to wrapped object.booleanequals(Object obj)Boilerplate API; calls through to wrapped object.intgetOffset(int era, int year, int month, int day, int dayOfWeek, int millis)TimeZone API; calls through to wrapped time zone.intgetRawOffset()TimeZone API; calls through to wrapped time zone.inthashCode()Boilerplate API; calls through to wrapped object.booleanhasSameRules(TimeZone other)TimeZone API; calls through to wrapped time zone.booleaninDaylightTime(Date date)TimeZone API; calls through to wrapped time zone.voidsetID(String ID)TimeZone API; calls through to wrapped time zone.voidsetRawOffset(int offsetMillis)TimeZone API; calls through to wrapped time zone.StringtoString()Returns a string representation of this object.TimeZoneunwrap()Return the java.util.TimeZone wrapped by this object.booleanuseDaylightTime()TimeZone API; calls through to wrapped time zone.static TimeZonewrap(TimeZone tz)Given a java.util.TimeZone, wrap it in the appropriate adapter subclass of com.ibm.icu.util.TimeZone and return the adapter.-
Methods inherited from class java.util.TimeZone
createGmtOffsetString, getAvailableIDs, getAvailableIDs, getDefault, getDisplayName, getDisplayName, getDisplayName, getDisplayName, getDSTSavings, getID, getOffset, getTimeZone, setDefault
-
-
-
-
Constructor Detail
-
TimeZoneAdapter
public TimeZoneAdapter(TimeZone zone)
Constructs an adapter for a com.ibm.icu.util.TimeZone object.
-
-
Method Detail
-
wrap
public static 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(String ID)
TimeZone API; calls through to wrapped time zone.
-
hasSameRules
public boolean hasSameRules(TimeZone other)
TimeZone API; calls through to wrapped time zone.- Overrides:
hasSameRulesin classTimeZone
-
getOffset
public int getOffset(int era, int year, int month, int day, int dayOfWeek, int millis)TimeZone API; calls through to wrapped time zone.
-
getRawOffset
public int getRawOffset()
TimeZone API; calls through to wrapped time zone.- Specified by:
getRawOffsetin classTimeZone
-
setRawOffset
public void setRawOffset(int offsetMillis)
TimeZone API; calls through to wrapped time zone.- Specified by:
setRawOffsetin classTimeZone
-
useDaylightTime
public boolean useDaylightTime()
TimeZone API; calls through to wrapped time zone.- Specified by:
useDaylightTimein classTimeZone
-
inDaylightTime
public boolean inDaylightTime(Date date)
TimeZone API; calls through to wrapped time zone.- Specified by:
inDaylightTimein classTimeZone
-
clone
public Object clone()
Boilerplate API; calls through to wrapped object.
-
hashCode
public int hashCode()
Boilerplate API; calls through to wrapped object.- Overrides:
hashCodein classObject- Returns:
- this object's hash code.
- See Also:
Object.equals(java.lang.Object)
-
equals
public boolean equals(Object obj)
Boilerplate API; calls through to wrapped object.- Overrides:
equalsin classObject- Parameters:
obj- the object to compare this instance with.- Returns:
trueif the specified object is equal to thisObject;falseotherwise.- See Also:
Object.hashCode()
-
-