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.Constructor and Description |
---|
InitialTimeZoneRule(String name,
int rawOffset,
int dstSavings)
Constructs a
InitialTimeZoneRule with the name, the GMT offset of its
standard time and the amount of daylight saving offset adjustment. |
Modifier and Type | Method and Description |
---|---|
Date |
getFinalStart(int prevRawOffset,
int prevDSTSavings)
Gets the final time when this rule takes effect.
|
Date |
getFirstStart(int prevRawOffset,
int prevDSTSavings)
Gets the very first time when this rule takes effect.
|
Date |
getNextStart(long base,
int prevRawOffset,
int prevDSTSavings,
boolean inclusive)
Gets the first time when this rule takes effect after the specified time.
|
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 this
TimeZoneRule has one or more start times. |
getDSTSavings, getName, getRawOffset, toString
public InitialTimeZoneRule(String name, int rawOffset, int dstSavings)
InitialTimeZoneRule
with the name, the GMT offset of its
standard time and the amount of daylight saving offset adjustment.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.public boolean isEquivalentTo(TimeZoneRule other)
TimeZoneRule
objects differ only its names, this method returns
true.isEquivalentTo
in class TimeZoneRule
other
- The TimeZoneRule
object to be compared with.TimeZoneRule
is the same as this one.public Date getFinalStart(int prevRawOffset, int prevDSTSavings)
InitialTimeZoneRule
always returns null.getFinalStart
in class TimeZoneRule
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.public Date getFirstStart(int prevRawOffset, int prevDSTSavings)
InitialTimeZoneRule
always returns null.getFirstStart
in class TimeZoneRule
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.public Date getNextStart(long base, int prevRawOffset, int prevDSTSavings, boolean inclusive)
InitialTimeZoneRule
always returns null.getNextStart
in class TimeZoneRule
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.public Date getPreviousStart(long base, int prevRawOffset, int prevDSTSavings, boolean inclusive)
InitialTimeZoneRule
always returns null.getPreviousStart
in class TimeZoneRule
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.public boolean isTransitionRule()
TimeZoneRule
has one or more start times.InitialTimeZoneRule
always returns false.isTransitionRule
in class TimeZoneRule
TimeZoneRule
has one or more start times.Copyright (c) 2016 IBM Corporation and others.