Class TimeArrayTimeZoneRule
java.lang.Object
org.graalvm.shadowed.com.ibm.icu.util.TimeZoneRule
org.graalvm.shadowed.com.ibm.icu.util.TimeArrayTimeZoneRule
- All Implemented Interfaces:
Serializable
TimeArrayTimeZoneRule represents a time zone rule whose start times are
defined by an array of milliseconds since the standard base time.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionTimeArrayTimeZoneRule(String name, int rawOffset, int dstSavings, long[] startTimes, int timeType) Constructs aTimeArrayTimeZoneRulewith the name, the GMT offset of its standard time, the amount of daylight saving offset adjustment and the array of times when this rule takes effect. -
Method Summary
Modifier and TypeMethodDescriptiongetFinalStart(int prevRawOffset, int prevDSTSavings) Gets the final time when this rule takes effect.getFirstStart(int prevRawOffset, int prevDSTSavings) Gets the very first time when this rule takes effect.getNextStart(long base, int prevOffset, int prevDSTSavings, boolean inclusive) Gets the first time when this rule takes effect after the specified time.getPreviousStart(long base, int prevOffset, int prevDSTSavings, boolean inclusive) Gets the most recent time when this rule takes effect before the specified time.long[]Gets the array of start times used by this rule.intGets the time type of the start times used by this rule.booleanisEquivalentTo(TimeZoneRule other) Returns if this rule represents the same rule and offsets as another.booleanReturns if thisTimeZoneRulehas one or more start times.toString()Returns aStringrepresentation of thisTimeArrayTimeZoneRuleobject.Methods inherited from class org.graalvm.shadowed.com.ibm.icu.util.TimeZoneRule
getDSTSavings, getName, getRawOffset
-
Constructor Details
-
TimeArrayTimeZoneRule
public TimeArrayTimeZoneRule(String name, int rawOffset, int dstSavings, long[] startTimes, int timeType) Constructs aTimeArrayTimeZoneRulewith the name, the GMT offset of its standard time, the amount of daylight saving offset adjustment and the array of times when this rule takes effect.- Parameters:
name- The time zone name.rawOffset- The UTC offset of its standard time in milliseconds.dstSavings- The amount of daylight saving offset adjustment in milliseconds. If this ia a rule for standard time, the value of this argument is 0.startTimes- The start times in milliseconds since the base time (January 1, 1970, 00:00:00).timeType- The time type of the start times, which is one ofDataTimeRule.WALL_TIME,STANDARD_TIMEandUTC_TIME.
-
-
Method Details
-
getStartTimes
public long[] getStartTimes()Gets the array of start times used by this rule.- Returns:
- An array of the start times in milliseconds since the base time (January 1, 1970, 00:00:00 GMT).
-
getTimeType
public int getTimeType()Gets the time type of the start times used by this rule. The return value is eitherDateTimeRule.WALL_TIMEorDateTimeRule.STANDARD_TIMEorDateTimeRule.UTC_TIME.- Returns:
- The time type used of the start times used by this rule.
-
getFirstStart
Gets the very first time when this rule takes effect.- Specified by:
getFirstStartin classTimeZoneRule- Parameters:
prevRawOffset- The standard time offset from UTC before this rule takes effect in milliseconds.prevDSTSavings- The amount of daylight saving offset from the standard time.- Returns:
- The very first time when this rule takes effect.
-
getFinalStart
Gets the final time when this rule takes effect.- Specified by:
getFinalStartin classTimeZoneRule- Parameters:
prevRawOffset- The standard time offset from UTC before this rule takes effect in milliseconds.prevDSTSavings- The amount of daylight saving offset from the standard time.- Returns:
- The very last time when this rule takes effect, or null if this rule is applied for future dates infinitely.
-
getNextStart
Gets the first time when this rule takes effect after the specified time.- Specified by:
getNextStartin classTimeZoneRule- Parameters:
base- The first time after this time is returned.prevOffset- The standard time offset from UTC before this rule takes effect in milliseconds.prevDSTSavings- The amount of daylight saving offset from the standard time.inclusive- Whether the base time is inclusive or not.- Returns:
- The first time when this rule takes effect after the specified time, or null when this rule never takes effect after the specified time.
-
getPreviousStart
Gets the most recent time when this rule takes effect before the specified time.- Specified by:
getPreviousStartin classTimeZoneRule- Parameters:
base- The most recent time when this rule takes effect before this time is returned.prevOffset- The standard time offset from UTC before this rule takes effect in milliseconds.prevDSTSavings- The amount of daylight saving offset from the standard time.inclusive- Whether the base time is inclusive or not.- Returns:
- The most recent time when this rule takes effect before the specified time, or null when this rule never takes effect before the specified time.
-
isEquivalentTo
Returns if this rule represents the same rule and offsets as another. When twoTimeZoneRuleobjects differ only its names, this method returns true.- Overrides:
isEquivalentToin classTimeZoneRule- Parameters:
other- TheTimeZoneRuleobject to be compared with.- Returns:
- true if the other
TimeZoneRuleis the same as this one.
-
isTransitionRule
public boolean isTransitionRule()Returns if thisTimeZoneRulehas one or more start times.
Note: This method inTimeArrayTimeZoneRulealways returns true.- Specified by:
isTransitionRulein classTimeZoneRule- Returns:
- true if this
TimeZoneRulehas one or more start times.
-
toString
Returns aStringrepresentation of thisTimeArrayTimeZoneRuleobject. This method is used for debugging purpose only. The string representation can be changed in future version of ICU without any notice.- Overrides:
toStringin classTimeZoneRule
-