Package com.ibm.icu.util
Class InitialTimeZoneRule
- java.lang.Object
-
- com.ibm.icu.util.TimeZoneRule
-
- com.ibm.icu.util.InitialTimeZoneRule
-
- All Implemented Interfaces:
java.io.Serializable
public class InitialTimeZoneRule extends TimeZoneRule
InitialTimeZoneRule
represents a time zone rule representing a time zone effective from the beginning and has no actual start times.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description InitialTimeZoneRule(java.lang.String name, int rawOffset, int dstSavings)
Constructs aInitialTimeZoneRule
with the name, the GMT offset of its standard time and the amount of daylight saving offset adjustment.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Date
getFinalStart(int prevRawOffset, int prevDSTSavings)
Gets the final time when this rule takes effect.java.util.Date
getFirstStart(int prevRawOffset, int prevDSTSavings)
Gets the very first time when this rule takes effect.java.util.Date
getNextStart(long base, int prevRawOffset, int prevDSTSavings, boolean inclusive)
Gets the first time when this rule takes effect after the specified time.java.util.Date
getPreviousStart(long base, int prevRawOffset, int prevDSTSavings, boolean inclusive)
Gets the most recent time when this rule takes effect before the specified time.boolean
isEquivalentTo(TimeZoneRule other)
Returns if this rule represents the same rule and offsets as another.boolean
isTransitionRule()
Returns if thisTimeZoneRule
has one or more start times.-
Methods inherited from class com.ibm.icu.util.TimeZoneRule
getDSTSavings, getName, getRawOffset, toString
-
-
-
-
Constructor Detail
-
InitialTimeZoneRule
public InitialTimeZoneRule(java.lang.String name, int rawOffset, int dstSavings)
Constructs aInitialTimeZoneRule
with the name, the GMT offset of its standard time and the amount of daylight saving offset adjustment.- 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.
-
-
Method Detail
-
isEquivalentTo
public boolean isEquivalentTo(TimeZoneRule other)
Returns if this rule represents the same rule and offsets as another. When twoTimeZoneRule
objects differ only its names, this method returns true.- Overrides:
isEquivalentTo
in classTimeZoneRule
- Parameters:
other
- TheTimeZoneRule
object to be compared with.- Returns:
- true if the other
TimeZoneRule
is the same as this one.
-
getFinalStart
public java.util.Date getFinalStart(int prevRawOffset, int prevDSTSavings)
Gets the final time when this rule takes effect.
Note: This method inInitialTimeZoneRule
always returns null.- Specified by:
getFinalStart
in 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.
-
getFirstStart
public java.util.Date getFirstStart(int prevRawOffset, int prevDSTSavings)
Gets the very first time when this rule takes effect.
Note: This method inInitialTimeZoneRule
always returns null.- Specified by:
getFirstStart
in 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.
-
getNextStart
public java.util.Date getNextStart(long base, int prevRawOffset, int prevDSTSavings, boolean inclusive)
Gets the first time when this rule takes effect after the specified time.
Note: This method inInitialTimeZoneRule
always returns null.- Specified by:
getNextStart
in classTimeZoneRule
- Parameters:
base
- The first time after this time is returned.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.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
public java.util.Date getPreviousStart(long base, int prevRawOffset, int prevDSTSavings, boolean inclusive)
Gets the most recent time when this rule takes effect before the specified time.
Note: This method inInitialTimeZoneRule
always returns null.- Specified by:
getPreviousStart
in classTimeZoneRule
- Parameters:
base
- The most recent time when this rule takes effect before this time is returned.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.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.
-
isTransitionRule
public boolean isTransitionRule()
Returns if thisTimeZoneRule
has one or more start times.
Note: This method inInitialTimeZoneRule
always returns false.- Specified by:
isTransitionRule
in classTimeZoneRule
- Returns:
- true if this
TimeZoneRule
has one or more start times.
-
-