com.ibm.icu.util
Class BasicTimeZone

java.lang.Object
  extended by com.ibm.icu.util.TimeZone
      extended by com.ibm.icu.util.BasicTimeZone
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
RuleBasedTimeZone, SimpleTimeZone, VTimeZone

public abstract class BasicTimeZone
extends TimeZone

[icu] BasicTimeZone extends TimeZone with additional methods to access time zone transitions and rules. All ICU TimeZone concrete subclasses extend this class. APIs added to java.util.TimeZone by BasicTimeZone are annotated with '[icu]'.

See Also:
TimeZoneRule, TimeZoneTransition, Serialized Form
Status:
Stable ICU 3.8.

Nested Class Summary
 
Nested classes/interfaces inherited from class com.ibm.icu.util.TimeZone
TimeZone.SystemTimeZoneType
 
Field Summary
protected static int FORMER_LATTER_MASK
          Deprecated. This API is ICU internal only.
static int LOCAL_DST
          Deprecated. This API is ICU internal only.
static int LOCAL_FORMER
          Deprecated. This API is ICU internal only.
static int LOCAL_LATTER
          Deprecated. This API is ICU internal only.
static int LOCAL_STD
          Deprecated. This API is ICU internal only.
protected static int STD_DST_MASK
          Deprecated. This API is ICU internal only.
 
Fields inherited from class com.ibm.icu.util.TimeZone
GENERIC_LOCATION, LONG, LONG_GENERIC, LONG_GMT, SHORT, SHORT_COMMONLY_USED, SHORT_GENERIC, SHORT_GMT, TIMEZONE_ICU, TIMEZONE_JDK, TimeZoneLogger, UNKNOWN_ZONE_ID
 
Constructor Summary
protected BasicTimeZone()
          Protected no arg constructor.
 
Method Summary
abstract  TimeZoneTransition getNextTransition(long base, boolean inclusive)
          [icu] Returns the first time zone transition after the base time.
 void getOffsetFromLocal(long date, int nonExistingTimeOpt, int duplicatedTimeOpt, int[] offsets)
          Deprecated. This API is ICU internal only.
abstract  TimeZoneTransition getPreviousTransition(long base, boolean inclusive)
          [icu] Returns the last time zone transition before the base time.
 TimeZoneRule[] getSimpleTimeZoneRulesNear(long date)
          [icu] Returns the array of TimeZoneRule which represents the rule of this time zone object near the specified date.
abstract  TimeZoneRule[] getTimeZoneRules()
          [icu] Returns the array of TimeZoneRule which represents the rule of this time zone object.
 TimeZoneRule[] getTimeZoneRules(long start)
          [icu] Returns the array of TimeZoneRule which represents the rule of this time zone object since the specified start time.
 boolean hasEquivalentTransitions(TimeZone tz, long start, long end)
          [icu] Checks if the time zone has equivalent transitions in the time range.
 boolean hasEquivalentTransitions(TimeZone tz, long start, long end, boolean ignoreDstAmount)
          [icu] Checks if the time zone has equivalent transitions in the time range.
 
Methods inherited from class com.ibm.icu.util.TimeZone
clone, countEquivalentIDs, equals, getAvailableIDs, getAvailableIDs, getAvailableIDs, getAvailableIDs, getCanonicalID, getCanonicalID, getDefault, getDefaultTimeZoneType, getDisplayName, getDisplayName, getDisplayName, getDisplayName, getDisplayName, getDisplayName, getDSTSavings, getEquivalentID, getID, getOffset, getOffset, getOffset, getRawOffset, getRegion, getTimeZone, getTimeZone, getTZDataVersion, hashCode, hasSameRules, inDaylightTime, setDefault, setDefaultTimeZoneType, setID, setRawOffset, useDaylightTime
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCAL_STD

public static final int LOCAL_STD
Deprecated. This API is ICU internal only.
[icu] The time type option for standard time used by getOffsetFromLocal(long, int, int, int[])

See Also:
Constant Field Values
Status:
Internal. This API is ICU internal only.

LOCAL_DST

public static final int LOCAL_DST
Deprecated. This API is ICU internal only.
[icu] The time type option for daylight saving time used by getOffsetFromLocal(long, int, int, int[])

See Also:
Constant Field Values
Status:
Internal. This API is ICU internal only.

LOCAL_FORMER

public static final int LOCAL_FORMER
Deprecated. This API is ICU internal only.
[icu] The option designate former time to be used by getOffsetFromLocal(long, int, int, int[])

See Also:
Constant Field Values
Status:
Internal. This API is ICU internal only.

LOCAL_LATTER

public static final int LOCAL_LATTER
Deprecated. This API is ICU internal only.
[icu] The option designate latter time to be used by getOffsetFromLocal(long, int, int, int[])

See Also:
Constant Field Values
Status:
Internal. This API is ICU internal only.

STD_DST_MASK

protected static final int STD_DST_MASK
Deprecated. This API is ICU internal only.
[icu] The bit mask for the time type option used by getOffsetFromLocal(long, int, int, int[])

See Also:
Constant Field Values
Status:
Internal. This API is ICU internal only.

FORMER_LATTER_MASK

protected static final int FORMER_LATTER_MASK
Deprecated. This API is ICU internal only.
[icu] The bit mask for the former/latter option used by getOffsetFromLocal(long, int, int, int[])

See Also:
Constant Field Values
Status:
Internal. This API is ICU internal only.
Constructor Detail

BasicTimeZone

protected BasicTimeZone()
Protected no arg constructor.

Status:
Stable ICU 3.8.
Method Detail

getNextTransition

public abstract TimeZoneTransition getNextTransition(long base,
                                                     boolean inclusive)
[icu] Returns the first time zone transition after the base time.

Parameters:
base - The base time.
inclusive - Whether the base time is inclusive or not.
Returns:
A Date holding the first time zone transition time after the given base time, or null if no time zone transitions are available after the base time.
Status:
Stable ICU 3.8.

getPreviousTransition

public abstract TimeZoneTransition getPreviousTransition(long base,
                                                         boolean inclusive)
[icu] Returns the last time zone transition before the base time.

Parameters:
base - The base time.
inclusive - Whether the base time is inclusive or not.
Returns:
A Date holding the last time zone transition time before the given base time, or null if no time zone transitions are available before the base time.
Status:
Stable ICU 3.8.

hasEquivalentTransitions

public boolean hasEquivalentTransitions(TimeZone tz,
                                        long start,
                                        long end)
[icu] Checks if the time zone has equivalent transitions in the time range. This method returns true when all of transition times, from/to standard offsets and DST savings used by this time zone match the other in the time range.

Parameters:
tz - The instance of TimeZone
start - The start time of the evaluated time range (inclusive)
end - The end time of the evaluated time range (inclusive)
Returns:
true if the other time zone has the equivalent transitions in the time range. When tz is not a BasicTimeZone, this method returns false.
Status:
Stable ICU 3.8.

hasEquivalentTransitions

public boolean hasEquivalentTransitions(TimeZone tz,
                                        long start,
                                        long end,
                                        boolean ignoreDstAmount)
[icu] Checks if the time zone has equivalent transitions in the time range. This method returns true when all of transition times, from/to standard offsets and DST savings used by this time zone match the other in the time range.

Parameters:
tz - The instance of TimeZone
start - The start time of the evaluated time range (inclusive)
end - The end time of the evaluated time range (inclusive)
ignoreDstAmount - When true, any transitions with only daylight saving amount changes will be ignored, except either of them is zero. For example, a transition from rawoffset 3:00/dstsavings 1:00 to rawoffset 2:00/dstsavings 2:00 is excluded from the comparison, but a transtion from rawoffset 2:00/dstsavings 1:00 to rawoffset 3:00/dstsavings 0:00 is included.
Returns:
true if the other time zone has the equivalent transitions in the time range. When tz is not a BasicTimeZone, this method returns false.
Status:
Stable ICU 3.8.

getTimeZoneRules

public abstract TimeZoneRule[] getTimeZoneRules()
[icu] Returns the array of TimeZoneRule which represents the rule of this time zone object. The first element in the result array will be the InitialTimeZoneRule instance for the initial rule. The rest will be either AnnualTimeZoneRule or TimeArrayTimeZoneRule instances representing transitions.

Returns:
The array of TimeZoneRule which represents this time zone.
Status:
Stable ICU 3.8.

getTimeZoneRules

public TimeZoneRule[] getTimeZoneRules(long start)
[icu] Returns the array of TimeZoneRule which represents the rule of this time zone object since the specified start time. The first element in the result array will be the InitialTimeZoneRule instance for the initial rule. The rest will be either AnnualTimeZoneRule or TimeArrayTimeZoneRule instances representing transitions.

Parameters:
start - The start time (inclusive).
Returns:
The array of TimeZoneRule which represents this time zone since the start time.
Status:
Stable ICU 3.8.

getSimpleTimeZoneRulesNear

public TimeZoneRule[] getSimpleTimeZoneRulesNear(long date)
[icu] Returns the array of TimeZoneRule which represents the rule of this time zone object near the specified date. Some applications are not capable to handle historic time zone rule changes. Also some applications can only handle certain type of rule definitions. This method returns either a single InitialTimeZoneRule if this time zone does not have any daylight saving time within 1 year from the specified time, or a pair of AnnualTimeZoneRule whose rule type is DateTimeRule.DOW for date and DateTimeRule.WALL_TIME for time with a single InitialTimeZoneRule representing the initial time, when this time zone observes daylight saving time near the specified date. Thus, the result may be only valid for dates around the specified date.

Parameters:
date - The date to be used for TimeZoneRule extraction.
Returns:
The array of TimeZoneRule, either a single InitialTimeZoneRule object, or a pair of AnnualTimeZoneRule with a single InitialTimeZoneRule. The first element in the array is always a InitialTimeZoneRule.
Status:
Stable ICU 3.8.

getOffsetFromLocal

public void getOffsetFromLocal(long date,
                               int nonExistingTimeOpt,
                               int duplicatedTimeOpt,
                               int[] offsets)
Deprecated. This API is ICU internal only.

[icu] Returns time zone offsets from local wall time.

Status:
Internal. This API is ICU internal only.


Copyright (c) 2011 IBM Corporation and others.