RuleBasedTimeZone is a concrete subclass of TimeZone that allows users to define
custom historic time transition rules.
com.ibm.icu.util.TimeZoneRule
| Modifier and Type | Field and Description |
|---|---|
| private AnnualTimeZoneRule[] | |
| private List | |
| private transient List | |
| private final InitialTimeZoneRule | |
| private transient volatile boolean | |
| private static final long | |
| private transient boolean |
| Access | Constructor and Description |
|---|---|
| public | RuleBasedTimeZone(String
The time zone ID. id, InitialTimeZoneRule The initial time zone rule. initialRule)Constructs a |
| Modifier and Type | Method and Description |
|---|---|
| public void | addTransitionRule(TimeZoneRule
The rule)TimeZoneRule.Adds the |
| public Object | |
| public TimeZone | cloneAsThawed()
Overrides com. Implements com. |
| private void | |
| private TimeZoneRule | |
| public TimeZone | freeze()
Overrides com. Implements com. |
| private static int | getLocalDelta(int rawBefore, int dstBefore, int rawAfter, int dstAfter, int NonExistingTimeOpt, int DuplicatedTimeOpt)
|
| public TimeZoneTransition | getNextTransition(long
The base time. base, boolean Whether the base time is inclusive or not. inclusive)Implements abstract com. ICU |
| 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 millis in day in standard local time. milliseconds)Implements abstract com. |
| public void | getOffset(long
moment in time for which to return offsets, in
units of milliseconds from January 1, 1970 0:00 GMT, either GMT
time or local wall time, depending on time, boolean local.if true, local, int[] date is local wall time; otherwise it
is in GMT time.output parameter to receive the raw offset, that
is, the offset not including DST adjustments, in offsets[0],
and the DST offset, that is, the offset to be added to
offsets)rawOffset to obtain the total offset between local and GMT
time, in offsets[1]. If DST is not in effect, the DST offset is
zero; otherwise it is a positive value, typically one hour.Overrides com. |
| private void | |
| public void | getOffsetFromLocal(long date, BasicTimeZone.
Overrides com. ICU |
| public TimeZoneTransition | getPreviousTransition(long
The base time. base, boolean Whether the base time is inclusive or not. inclusive)Implements abstract com. ICU |
| public int | getRawOffset()
Implements abstract com. |
| public TimeZoneRule[] | |
| private static long | getTransitionTime(TimeZoneTransition tzt, boolean local, int NonExistingTimeOpt, int DuplicatedTimeOpt)
|
| public boolean | hasSameRules(TimeZone
the other)TimeZone object to be compared withOverrides com. |
| public boolean | inDaylightTime(Date
the given Date. date)Implements abstract com. |
| public boolean | isFrozen()
Overrides com. Implements com. |
| public boolean | observesDaylightTime()
Queries if this time zone is in daylight saving time or will observe
daylight saving time at any future time.
|
| public void | setRawOffset(int
the given base time zone offset to GMT. offsetMillis)Implements abstract com. |
| public boolean | useDaylightTime()
Implements abstract com. |
| finalRules | back to summary |
|---|---|
| private AnnualTimeZoneRule[] finalRules | |
| historicRules | back to summary |
|---|---|
| private List<TimeZoneRule> historicRules | |
| historicTransitions | back to summary |
|---|---|
| private transient List<TimeZoneTransition> historicTransitions | |
| initialRule | back to summary |
|---|---|
| private final InitialTimeZoneRule initialRule | |
| isFrozen | back to summary |
|---|---|
| private transient volatile boolean isFrozen | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| upToDate | back to summary |
|---|---|
| private transient boolean upToDate | |
| RuleBasedTimeZone | back to summary |
|---|---|
| public RuleBasedTimeZone(String id, InitialTimeZoneRule initialRule) Constructs a
| |
| addTransitionRule | back to summary |
|---|---|
| public void addTransitionRule(TimeZoneRule rule) Adds the
| |
| clone | back to summary |
|---|---|
| public Object clone() Overrides com. Doc from com. Overrides clone.
| |
| cloneAsThawed | back to summary |
|---|---|
| public TimeZone cloneAsThawed() Overrides com. Implements com. Doc from com. Provides for the clone operation. Any clone is initially unfrozen. | |
| complete | back to summary |
|---|---|
| private void complete() | |
| findRuleInFinal | back to summary |
|---|---|
| private TimeZoneRule findRuleInFinal(long time, boolean local, int NonExistingTimeOpt, int DuplicatedTimeOpt) | |
| freeze | back to summary |
|---|---|
| public TimeZone freeze() Overrides com. Implements com. Doc from com. Freezes the object.
| |
| getLocalDelta | back to summary |
|---|---|
| private static int getLocalDelta(int rawBefore, int dstBefore, int rawAfter, int dstAfter, int NonExistingTimeOpt, int DuplicatedTimeOpt) | |
| getNextTransition | back to summary |
|---|---|
| public TimeZoneTransition getNextTransition(long base, boolean inclusive) Implements abstract com. Doc from com. ICU Example code:{@. jcite com.ibm.icu.samples.util.timezone.BasicTimeZoneExample:---getNextTransitionExample}
| |
| getOffset | back to summary |
|---|---|
| public int getOffset(int era, int year, int month, int day, int dayOfWeek, int milliseconds) Implements abstract com. Doc from com. Gets the time zone offset, for current date, modified in case of daylight savings. This is the offset to add to UTC to get local time.
| |
| getOffset | back to summary |
|---|---|
| public void getOffset(long time, boolean local, int[] offsets) Overrides com. Doc from com. Returns the time zone raw and GMT offset for the given moment in time. Upon return, local-millis = GMT-millis + rawOffset + dstOffset. All computations are performed in the proleptic Gregorian calendar. The default implementation in the TimeZone class delegates to the 8-argument getOffset().
| |
| getOffset | back to summary |
|---|---|
| private void getOffset(long time, boolean local, int NonExistingTimeOpt, int DuplicatedTimeOpt, int[] offsets) | |
| getOffsetFromLocal | back to summary |
|---|---|
| public void getOffsetFromLocal(long date, BasicTimeZone. Overrides com. Doc from com. ICU | |
| getPreviousTransition | back to summary |
|---|---|
| public TimeZoneTransition getPreviousTransition(long base, boolean inclusive) Implements abstract com. Doc from com. ICU Example code:{@. jcite com.ibm.icu.samples.util.timezone.BasicTimeZoneExample:---getPreviousTransitionExample}
| |
| getRawOffset | back to summary |
|---|---|
| public int getRawOffset() Implements abstract com. Doc from com. Gets unmodified offset, NOT modified in case of daylight savings. This is the offset to add to UTC to get local time. | |
| getTimeZoneRules | back to summary |
|---|---|
| public TimeZoneRule[] getTimeZoneRules() Implements abstract com. Doc from com. ICU 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.
| |
| getTransitionTime | back to summary |
|---|---|
| private static long getTransitionTime(TimeZoneTransition tzt, boolean local, int NonExistingTimeOpt, int DuplicatedTimeOpt) | |
| hasSameRules | back to summary |
|---|---|
| public boolean hasSameRules(TimeZone other) Overrides com. Doc from com. Returns true if this zone has the same rule and offset as another zone. That is, if this zone differs only in ID, if at all. Returns false if the other zone is null. | |
| inDaylightTime | back to summary |
|---|---|
| public boolean inDaylightTime(Date date) Implements abstract com. Doc from com. Queries if the given date is in daylight savings time in this time zone. | |
| isFrozen | back to summary |
|---|---|
| public boolean isFrozen() Overrides com. Implements com. Doc from com. Determines whether the object has been frozen or not. | |
| observesDaylightTime | back to summary |
|---|---|
| public boolean observesDaylightTime() Overrides com. Doc from com. Queries if this time zone is in daylight saving time or will observe daylight saving time at any future time. The default implementation in this class returns Note This method was added for
ICU's TimeZone subclass implementations override this method to support the same behavior
with | |
| setRawOffset | back to summary |
|---|---|
| public void setRawOffset(int offsetMillis) Implements abstract com. Doc from com. Sets the base time zone offset to GMT. This is the offset to add to UTC to get local time. | |
| useDaylightTime | back to summary |
|---|---|
| public boolean useDaylightTime() Implements abstract com. Doc from com. Queries if this time zone uses daylight savings time.
| |