Top Description Fields Constructors Methods
com.ibm.icu.impl

public Class TimeZoneAdapter

extends TimeZone
Class Inheritance
Imports
java.util.Date, com.ibm.icu.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.
Author
Alan Liu
Since
ICU 2.8
See Also
com.ibm.icu.util.TimeZone#setDefault

Field Summary

Modifier and TypeField and Description
pack-priv static final long
private TimeZone
zone

The contained com.ibm.icu.util.TimeZone object.

Inherited from java.util.TimeZone:
LONGSHORT

Constructor Summary

AccessConstructor and Description
public
TimeZoneAdapter(TimeZone zone)

Constructs an adapter for a com.ibm.icu.util.TimeZone object.

Method Summary

Modifier and TypeMethod and Description
public Object
clone()

Overrides java.util.TimeZone.clone.

Boilerplate API; calls through to wrapped object.
public boolean
equals(Object
the reference object with which to compare.
obj
)

Overrides java.lang.Object.equals.

Boilerplate API; calls through to wrapped object.
public int
getOffset(int
the era of the given date.
era
,
int
the year in the given date.
year
,
int
the month in the given date. Month is 0-based. e.g., 0 for January.
month
,
int
the day-in-month of the given date.
day
,
int
the day-of-week of the given date.
dayOfWeek
,
int
the milliseconds in day in standard local time.
millis
)

Implements abstract java.util.TimeZone.getOffset.

TimeZone API; calls through to wrapped time zone.
public int
getRawOffset()

Implements abstract java.util.TimeZone.getRawOffset.

TimeZone API; calls through to wrapped time zone.
public synchronized int
hashCode()

Overrides java.lang.Object.hashCode.

Boilerplate API; calls through to wrapped object.
public boolean
hasSameRules(TimeZone
the TimeZone object to be compared with
other
)

Overrides java.util.TimeZone.hasSameRules.

TimeZone API; calls through to wrapped time zone.
public boolean
inDaylightTime(Date
the given Date.
date
)

Implements abstract java.util.TimeZone.inDaylightTime.

TimeZone API; calls through to wrapped time zone.
public void
setID(String
the new time zone ID.
ID
)

Overrides java.util.TimeZone.setID.

TimeZone API; calls through to wrapped time zone.
public void
setRawOffset(int
the given base time zone offset to GMT.
offsetMillis
)

Implements abstract java.util.TimeZone.setRawOffset.

TimeZone API; calls through to wrapped time zone.
public String

Returns:

a string representation of this object.
toString
()

Overrides java.lang.Object.toString.

Returns a string representation of this object.
public TimeZone
unwrap()

Return the java.util.TimeZone wrapped by this object.

public boolean
useDaylightTime()

Implements abstract java.util.TimeZone.useDaylightTime.

TimeZone API; calls through to wrapped time zone.
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.

Inherited from java.util.TimeZone:
getAvailableIDsgetAvailableIDsgetDefaultgetDisplayNamegetDisplayNamegetDisplayNamegetDisplayNamegetDSTSavingsgetIDgetOffsetgetTimeZonegetTimeZoneobservesDaylightTimesetDefaulttoZoneId

Field Detail

serialVersionUIDback to summary
pack-priv static final long serialVersionUID

Hides java.util.TimeZone.serialVersionUID.

zoneback to summary
private TimeZone zone

The contained com.ibm.icu.util.TimeZone object. Must not be null. We delegate all methods to this object.

Constructor Detail

TimeZoneAdapterback to summary
public TimeZoneAdapter(TimeZone zone)

Constructs an adapter for a com.ibm.icu.util.TimeZone object.

Method Detail

cloneback to summary
public Object clone()

Overrides java.util.TimeZone.clone.

Boilerplate API; calls through to wrapped object.

Returns:Object

Doc from java.util.TimeZone.clone.

a clone of this TimeZone

Annotations
@Override
equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Boilerplate API; calls through to wrapped object.

Parameters
obj:Object

Doc from java.lang.Object.equals.

the reference object with which to compare.

Returns:boolean

Doc from java.lang.Object.equals.

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
getOffsetback to summary
public int getOffset(int era, int year, int month, int day, int dayOfWeek, int millis)

Implements abstract java.util.TimeZone.getOffset.

TimeZone API; calls through to wrapped time zone.

Parameters
era:int

Doc from java.util.TimeZone.getOffset.

the era of the given date.

year:int

Doc from java.util.TimeZone.getOffset.

the year in the given date.

month:int

Doc from java.util.TimeZone.getOffset.

the month in the given date. Month is 0-based. e.g., 0 for January.

day:int

Doc from java.util.TimeZone.getOffset.

the day-in-month of the given date.

dayOfWeek:int

Doc from java.util.TimeZone.getOffset.

the day-of-week of the given date.

millis:int

Doc from java.util.TimeZone.getOffset.

the milliseconds in day in standard local time.

Returns:int

Doc from java.util.TimeZone.getOffset.

the offset in milliseconds to add to GMT to get local time.

Annotations
@Override
getRawOffsetback to summary
public int getRawOffset()

Implements abstract java.util.TimeZone.getRawOffset.

TimeZone API; calls through to wrapped time zone.

Returns:int

Doc from java.util.TimeZone.getRawOffset.

the amount of raw offset time in milliseconds to add to UTC.

Annotations
@Override
hashCodeback to summary
public synchronized int hashCode()

Overrides java.lang.Object.hashCode.

Boilerplate API; calls through to wrapped object.

Returns:int

Doc from java.lang.Object.hashCode.

a hash code value for this object.

Annotations
@Override
hasSameRulesback to summary
public boolean hasSameRules(TimeZone other)

Overrides java.util.TimeZone.hasSameRules.

TimeZone API; calls through to wrapped time zone.

Parameters
other:TimeZone

Doc from java.util.TimeZone.hasSameRules.

the TimeZone object to be compared with

Returns:boolean

Doc from java.util.TimeZone.hasSameRules.

true if the other zone is not null and is the same as this one, with the possible exception of the ID

Annotations
@Override
inDaylightTimeback to summary
public boolean inDaylightTime(Date date)

Implements abstract java.util.TimeZone.inDaylightTime.

TimeZone API; calls through to wrapped time zone.

Parameters
date:Date

Doc from java.util.TimeZone.inDaylightTime.

the given Date.

Returns:boolean

Doc from java.util.TimeZone.inDaylightTime.

true if the given date is in Daylight Saving Time, false, otherwise.

Annotations
@Override
setIDback to summary
public void setID(String ID)

Overrides java.util.TimeZone.setID.

TimeZone API; calls through to wrapped time zone.

Parameters
ID:String

Doc from java.util.TimeZone.setID.

the new time zone ID.

Annotations
@Override
setRawOffsetback to summary
public void setRawOffset(int offsetMillis)

Implements abstract java.util.TimeZone.setRawOffset.

TimeZone API; calls through to wrapped time zone.

Parameters
offsetMillis:int

Doc from java.util.TimeZone.setRawOffset.

the given base time zone offset to GMT.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a string representation of this object.

Returns:String

a string representation of this object.

Annotations
@Override
unwrapback to summary
public TimeZone unwrap()

Return the java.util.TimeZone wrapped by this object.

useDaylightTimeback to summary
public boolean useDaylightTime()

Implements abstract java.util.TimeZone.useDaylightTime.

TimeZone API; calls through to wrapped time zone.

Returns:boolean

Doc from java.util.TimeZone.useDaylightTime.

true if this TimeZone uses Daylight Saving Time, false, otherwise.

Annotations
@Override
wrapback to summary
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.