Class BasicTimeZone
java.lang.Object
org.graalvm.shadowed.com.ibm.icu.util.TimeZone
org.graalvm.shadowed.com.ibm.icu.util.BasicTimeZone
- All Implemented Interfaces:
Serializable,Cloneable,Freezable<TimeZone>
- Direct Known Subclasses:
OlsonTimeZone,RuleBasedTimeZone,SimpleTimeZone,VTimeZone
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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumOptions used bygetOffsetFromLocal(long, LocalOption, LocalOption, int[])to specify how to interpret an input time when it does not exist, or when it is ambiguous, around a time zone transition.Nested classes/interfaces inherited from class org.graalvm.shadowed.com.ibm.icu.util.TimeZone
TimeZone.SystemTimeZoneType -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intDeprecated.This API is ICU internal only.protected static final intDeprecated.This API is ICU internal only.protected static final intDeprecated.This API is ICU internal only.protected static final intDeprecated.This API is ICU internal only.protected static final intDeprecated.This API is ICU internal only.protected static final intDeprecated.This API is ICU internal only.Fields inherited from class org.graalvm.shadowed.com.ibm.icu.util.TimeZone
GENERIC_LOCATION, GMT_ZONE, LONG, LONG_GENERIC, LONG_GMT, SHORT, SHORT_COMMONLY_USED, SHORT_GENERIC, SHORT_GMT, TIMEZONE_ICU, TIMEZONE_JDK, UNKNOWN_ZONE, UNKNOWN_ZONE_ID -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedProtected no arg constructor.protectedBasicTimeZone(String ID) Deprecated.This API is ICU internal only. -
Method Summary
Modifier and TypeMethodDescriptionprotected static intDeprecated.This API is ICU internal only.abstract TimeZoneTransitiongetNextTransition(long base, boolean inclusive) Returns the first time zone transition after the base time.voidgetOffsetFromLocal(long date, BasicTimeZone.LocalOption nonExistingTimeOpt, BasicTimeZone.LocalOption duplicatedTimeOpt, int[] offsets) Returns time zone offsets from local wall time.abstract TimeZoneTransitiongetPreviousTransition(long base, boolean inclusive) Returns the last time zone transition before the base time.getSimpleTimeZoneRulesNear(long date) Returns the array ofTimeZoneRulewhich represents the rule of this time zone object near the specified date.abstract TimeZoneRule[]Returns the array ofTimeZoneRulewhich represents the rule of this time zone object.getTimeZoneRules(long start) Returns the array ofTimeZoneRulewhich represents the rule of this time zone object since the specified start time.booleanhasEquivalentTransitions(TimeZone tz, long start, long end) Checks if the time zone has equivalent transitions in the time range.booleanhasEquivalentTransitions(TimeZone tz, long start, long end, boolean ignoreDstAmount) Checks if the time zone has equivalent transitions in the time range.Methods inherited from class org.graalvm.shadowed.com.ibm.icu.util.TimeZone
clone, cloneAsThawed, countEquivalentIDs, equals, forLocaleOrDefault, forULocaleOrDefault, freeze, getAvailableIDs, getAvailableIDs, getAvailableIDs, getAvailableIDs, getCanonicalID, getCanonicalID, getDefault, getDefaultTimeZoneType, getDisplayName, getDisplayName, getDisplayName, getDisplayName, getDisplayName, getDisplayName, getDSTSavings, getEquivalentID, getFrozenTimeZone, getIanaID, getID, getIDForWindowsID, getOffset, getOffset, getOffset, getRawOffset, getRegion, getTimeZone, getTimeZone, getTZDataVersion, getWindowsID, hashCode, hasSameRules, inDaylightTime, isFrozen, observesDaylightTime, setDefault, setDefaultTimeZoneType, setICUDefault, setID, setRawOffset, useDaylightTime
-
Field Details
-
LOCAL_STD
Deprecated.This API is ICU internal only.The time type option for standard time used by internal implementation.- See Also:
-
LOCAL_DST
Deprecated.This API is ICU internal only.The time type option for daylight saving time used internally.- See Also:
-
LOCAL_FORMER
Deprecated.This API is ICU internal only.The option designate former time used by internal implementation.- See Also:
-
LOCAL_LATTER
Deprecated.This API is ICU internal only.The option designate latter time used by internal implementation.- See Also:
-
STD_DST_MASK
Deprecated.This API is ICU internal only.The bit mask for the time type option used by internal implementation.- See Also:
-
FORMER_LATTER_MASK
Deprecated.This API is ICU internal only.The bit mask for the former/latter option used by internal implementation.- See Also:
-
-
Constructor Details
-
BasicTimeZone
protected BasicTimeZone()Protected no arg constructor. -
BasicTimeZone
Deprecated.This API is ICU internal only.Constructing a BasicTimeZone with the given time zone ID.- Parameters:
ID- the time zone ID.
-
-
Method Details
-
getNextTransition
Returns the first time zone transition after the base time.Example code:invalid input: '{@'.jcite org.graalvm.shadowed.com.ibm.icu.samples.util.timezone.BasicTimeZoneExample:---getNextTransitionExample}
- Parameters:
base- The base time.inclusive- Whether the base time is inclusive or not.- Returns:
- A
Dateholding the first time zone transition time after the given base time, or null if no time zone transitions are available after the base time.
-
getPreviousTransition
Returns the last time zone transition before the base time.Example code:invalid input: '{@'.jcite org.graalvm.shadowed.com.ibm.icu.samples.util.timezone.BasicTimeZoneExample:---getPreviousTransitionExample}
- Parameters:
base- The base time.inclusive- Whether the base time is inclusive or not.- Returns:
- A
Dateholding the last time zone transition time before the given base time, or null if no time zone transitions are available before the base time.
-
hasEquivalentTransitions
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.Example code:invalid input: '{@'.jcite org.graalvm.shadowed.com.ibm.icu.samples.util.timezone.BasicTimeZoneExample:---hasEquivalentTransitionsExample}
- Parameters:
tz- The instance ofTimeZonestart- 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.
-
hasEquivalentTransitions
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 ofTimeZonestart- 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 transition 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.
-
getTimeZoneRules
Returns the array ofTimeZoneRulewhich represents the rule of this time zone object. The first element in the result array will be theInitialTimeZoneRuleinstance for the initial rule. The rest will be eitherAnnualTimeZoneRuleorTimeArrayTimeZoneRuleinstances representing transitions.- Returns:
- The array of
TimeZoneRulewhich represents this time zone.
-
getTimeZoneRules
Returns the array ofTimeZoneRulewhich represents the rule of this time zone object since the specified start time. The first element in the result array will be theInitialTimeZoneRuleinstance for the initial rule. The rest will be eitherAnnualTimeZoneRuleorTimeArrayTimeZoneRuleinstances representing transitions.Example code:invalid input: '{@'.jcite org.graalvm.shadowed.com.ibm.icu.samples.util.timezone.BasicTimeZoneExample:---getTimeZoneRulesExample}
- Parameters:
start- The start time (inclusive).- Returns:
- The array of
TimeZoneRulewhich represents this time zone since the start time.
-
getSimpleTimeZoneRulesNear
Returns the array ofTimeZoneRulewhich 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 singleInitialTimeZoneRuleif this time zone does not have any daylight saving time within 1 year from the specified time, or a pair ofAnnualTimeZoneRulewhose rule type isDateTimeRule.DOWfor date andDateTimeRule.WALL_TIMEfor time with a singleInitialTimeZoneRulerepresenting 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 forTimeZoneRuleextraction.- Returns:
- The array of
TimeZoneRule, either a singleInitialTimeZoneRuleobject, or a pair ofAnnualTimeZoneRulewith a singleInitialTimeZoneRule. The first element in the array is always aInitialTimeZoneRule.
-
getLocalOptionValue
Deprecated.This API is ICU internal only.GetBasicTimeZone.LocalOption's internal flag value. This is used by ICU internal implementation only.- Parameters:
locOpt- A LocalOption- Returns:
- LocalOption's internal flag value.
-
getOffsetFromLocal
public void getOffsetFromLocal(long date, BasicTimeZone.LocalOption nonExistingTimeOpt, BasicTimeZone.LocalOption duplicatedTimeOpt, int[] offsets) Returns time zone offsets from local wall time.
-