Top Description Fields Constructors Methods
com.ibm.icu.util

public Class AnnualTimeZoneRule

extends TimeZoneRule
Class Inheritance
Imports
java.util.Date, com.ibm.icu.impl.Grego

AnnualTimeZoneRule is a class used for representing a time zone rule which takes effect annually. Years used in this class are all Gregorian calendar years.
ICU Status
Stable since ICU 3.8.

Field Summary

Modifier and TypeField and Description
private final DateTimeRule
private final int
public static final int
MAX_YEAR

The constant representing the maximum year used for designating a rule is permanent.

private static final long
private final int

Constructor Summary

AccessConstructor and Description
public
AnnualTimeZoneRule(String
The time zone name.
name
,
int
The GMT offset of its standard time in milliseconds.
rawOffset
,
int
The amount of daylight saving offset adjustment in milliseconds. If this ia a rule for standard time, the value of this argument is 0.
dstSavings
,
DateTimeRule
The start date/time rule repeated annually.
dateTimeRule
,
int
The first year when this rule takes effect.
startYear
,
int
The last year when this rule takes effect. If this rule is effective forever in future, specify MAX_YEAR.
endYear
)

Constructs a AnnualTimeZoneRule with the name, the GMT offset of its standard time, the amount of daylight saving offset adjustment, the annual start time rule and the start/until years.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

The end year of this rule (inclusive). The year is in Gregorian calendar with 0 == 1 BCE, -1 == 2 BCE, etc.
getEndYear
()

Gets the end year when this rule takes effect.

public Date
getFinalStart(int
The standard time offset from UTC before this rule takes effect in milliseconds.
prevRawOffset
,
int
The amount of daylight saving offset from the standard time.
prevDSTSavings
)

Implements abstract com.ibm.icu.util.TimeZoneRule.getFinalStart.

Gets the final time when this rule takes effect.
public Date
getFirstStart(int
The standard time offset from UTC before this rule takes effect in milliseconds.
prevRawOffset
,
int
The amount of daylight saving offset from the standard time.
prevDSTSavings
)

Implements abstract com.ibm.icu.util.TimeZoneRule.getFirstStart.

Gets the very first time when this rule takes effect.
public Date
getNextStart(long
The first time after this time is returned.
base
,
int
The standard time offset from UTC before this rule takes effect in milliseconds.
prevRawOffset
,
int
The amount of daylight saving offset from the standard time.
prevDSTSavings
,
boolean
Whether the base time is inclusive or not.
inclusive
)

Implements abstract com.ibm.icu.util.TimeZoneRule.getNextStart.

Gets the first time when this rule takes effect after the specified time.
public Date
getPreviousStart(long
The most recent time when this rule takes effect before this time is returned.
base
,
int
The standard time offset from UTC before this rule takes effect in milliseconds.
prevRawOffset
,
int
The amount of daylight saving offset from the standard time.
prevDSTSavings
,
boolean
Whether the base time is inclusive or not.
inclusive
)

Implements abstract com.ibm.icu.util.TimeZoneRule.getPreviousStart.

Gets the most recent time when this rule takes effect before the specified time.
public DateTimeRule

Returns:

An AnnualDateTimeRule which represents the start date/time rule used by this time zone rule.
getRule
()

Gets the start date/time rule associated used by this rule.

public Date

Returns:

The time when this rule takes effect in the year, or null if this rule is not applicable in the year.
getStartInYear
(int
The Gregorian year, with 0 == 1 BCE, -1 == 2 BCE, etc.
year
,
int
The standard time offset from UTC before this rule takes effect in milliseconds.
prevRawOffset
,
int
The amount of daylight saving offset from the standard time.
prevDSTSavings
)

Gets the time when this rule takes effect in the given year.

public int

Returns:

The start year of this rule. The year is in Gregorian calendar with 0 == 1 BCE, -1 == 2 BCE, etc.
getStartYear
()

Gets the first year when this rule takes effect.

public boolean
isEquivalentTo(TimeZoneRule
The TimeZoneRule object to be compared with.
other
)

Overrides com.ibm.icu.util.TimeZoneRule.isEquivalentTo.

Returns if this rule represents the same rule and offsets as another.
public boolean
isTransitionRule()

Implements abstract com.ibm.icu.util.TimeZoneRule.isTransitionRule.

Returns if this TimeZoneRule has one or more start times.
public String
toString()

Overrides com.ibm.icu.util.TimeZoneRule.toString.

Returns a String representation of this AnnualTimeZoneRule object.
Inherited from com.ibm.icu.util.TimeZoneRule:
getDSTSavingsgetNamegetRawOffset

Field Detail

dateTimeRuleback to summary
private final DateTimeRule dateTimeRule
endYearback to summary
private final int endYear
MAX_YEARback to summary
public static final int MAX_YEAR

The constant representing the maximum year used for designating a rule is permanent.

ICU Status
Stable since ICU 3.8.
serialVersionUIDback to summary
private static final long serialVersionUID

Hides com.ibm.icu.util.TimeZoneRule.serialVersionUID.

startYearback to summary
private final int startYear

Constructor Detail

AnnualTimeZoneRuleback to summary
public AnnualTimeZoneRule(String name, int rawOffset, int dstSavings, DateTimeRule dateTimeRule, int startYear, int endYear)

Constructs a AnnualTimeZoneRule with the name, the GMT offset of its standard time, the amount of daylight saving offset adjustment, the annual start time rule and the start/until years.

Parameters
name:String

The time zone name.

rawOffset:int

The GMT offset of its standard time in milliseconds.

dstSavings:int

The amount of daylight saving offset adjustment in milliseconds. If this ia a rule for standard time, the value of this argument is 0.

dateTimeRule:DateTimeRule

The start date/time rule repeated annually.

startYear:int

The first year when this rule takes effect.

endYear:int

The last year when this rule takes effect. If this rule is effective forever in future, specify MAX_YEAR.

ICU Status
Stable since ICU 3.8.

Method Detail

getEndYearback to summary
public int getEndYear()

Gets the end year when this rule takes effect.

Returns:int

The end year of this rule (inclusive). The year is in Gregorian calendar with 0 == 1 BCE, -1 == 2 BCE, etc.

ICU Status
Stable since ICU 3.8.
getFinalStartback to summary
public Date getFinalStart(int prevRawOffset, int prevDSTSavings)

Implements abstract com.ibm.icu.util.TimeZoneRule.getFinalStart.

Doc from com.ibm.icu.util.TimeZoneRule.getFinalStart.

Gets the final time when this rule takes effect.

Parameters
prevRawOffset:int

The standard time offset from UTC before this rule takes effect in milliseconds.

prevDSTSavings:int

The amount of daylight saving offset from the standard time.

Returns:Date

The very last time when this rule takes effect, or null if this rule is applied for future dates infinitely.

Annotations
@Override
ICU Status
Stable since ICU 3.8.
getFirstStartback to summary
public Date getFirstStart(int prevRawOffset, int prevDSTSavings)

Implements abstract com.ibm.icu.util.TimeZoneRule.getFirstStart.

Doc from com.ibm.icu.util.TimeZoneRule.getFirstStart.

Gets the very first time when this rule takes effect.

Parameters
prevRawOffset:int

The standard time offset from UTC before this rule takes effect in milliseconds.

prevDSTSavings:int

The amount of daylight saving offset from the standard time.

Returns:Date

The very first time when this rule takes effect.

Annotations
@Override
ICU Status
Stable since ICU 3.8.
getNextStartback to summary
public Date getNextStart(long base, int prevRawOffset, int prevDSTSavings, boolean inclusive)

Implements abstract com.ibm.icu.util.TimeZoneRule.getNextStart.

Doc from com.ibm.icu.util.TimeZoneRule.getNextStart.

Gets the first time when this rule takes effect after the specified time.

Parameters
base:long

The first time after this time is returned.

prevRawOffset:int

The standard time offset from UTC before this rule takes effect in milliseconds.

prevDSTSavings:int

The amount of daylight saving offset from the standard time.

inclusive:boolean

Whether the base time is inclusive or not.

Returns:Date

The first time when this rule takes effect after the specified time, or null when this rule never takes effect after the specified time.

Annotations
@Override
ICU Status
Stable since ICU 3.8.
getPreviousStartback to summary
public Date getPreviousStart(long base, int prevRawOffset, int prevDSTSavings, boolean inclusive)

Implements abstract com.ibm.icu.util.TimeZoneRule.getPreviousStart.

Doc from com.ibm.icu.util.TimeZoneRule.getPreviousStart.

Gets the most recent time when this rule takes effect before the specified time.

Parameters
base:long

The most recent time when this rule takes effect before this time is returned.

prevRawOffset:int

The standard time offset from UTC before this rule takes effect in milliseconds.

prevDSTSavings:int

The amount of daylight saving offset from the standard time.

inclusive:boolean

Whether the base time is inclusive or not.

Returns:Date

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.

Annotations
@Override
ICU Status
Stable since ICU 3.8.
getRuleback to summary
public DateTimeRule getRule()

Gets the start date/time rule associated used by this rule.

Returns:DateTimeRule

An AnnualDateTimeRule which represents the start date/time rule used by this time zone rule.

ICU Status
Stable since ICU 3.8.
getStartInYearback to summary
public Date getStartInYear(int year, int prevRawOffset, int prevDSTSavings)

Gets the time when this rule takes effect in the given year.

Parameters
year:int

The Gregorian year, with 0 == 1 BCE, -1 == 2 BCE, etc.

prevRawOffset:int

The standard time offset from UTC before this rule takes effect in milliseconds.

prevDSTSavings:int

The amount of daylight saving offset from the standard time.

Returns:Date

The time when this rule takes effect in the year, or null if this rule is not applicable in the year.

ICU Status
Stable since ICU 3.8.
getStartYearback to summary
public int getStartYear()

Gets the first year when this rule takes effect.

Returns:int

The start year of this rule. The year is in Gregorian calendar with 0 == 1 BCE, -1 == 2 BCE, etc.

ICU Status
Stable since ICU 3.8.
isEquivalentToback to summary
public boolean isEquivalentTo(TimeZoneRule other)

Overrides com.ibm.icu.util.TimeZoneRule.isEquivalentTo.

Doc from com.ibm.icu.util.TimeZoneRule.isEquivalentTo.

Returns if this rule represents the same rule and offsets as another. When two TimeZoneRule objects differ only its names, this method returns true.

Parameters
other:TimeZoneRule

The TimeZoneRule object to be compared with.

Returns:boolean

true if the other TimeZoneRule is the same as this one.

Annotations
@Override
ICU Status
Stable since ICU 3.8.
isTransitionRuleback to summary
public boolean isTransitionRule()

Implements abstract com.ibm.icu.util.TimeZoneRule.isTransitionRule.

Doc from com.ibm.icu.util.TimeZoneRule.isTransitionRule.

Returns if this TimeZoneRule has one or more start times.

Note: This method in AnnualTimeZoneRule always returns true.

Returns:boolean

true if this TimeZoneRule has one or more start times.

Annotations
@Override
ICU Status
Stable since ICU 3.8.
toStringback to summary
public String toString()

Overrides com.ibm.icu.util.TimeZoneRule.toString.

Returns a String representation of this AnnualTimeZoneRule object. This method is used for debugging purpose only. The string representation can be changed in future version of ICU without any notice.

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object.

Annotations
@Override
ICU Status
Stable since ICU 3.8.