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

public Class TimeArrayTimeZoneRule

extends TimeZoneRule
Class Inheritance
Imports
java.util.Arrays, .Date

TimeArrayTimeZoneRule represents a time zone rule whose start times are defined by an array of milliseconds since the standard base time.
ICU Status
Stable since ICU 3.8.

Field Summary

Modifier and TypeField and Description
private static final long
private final long[]
private final int

Constructor Summary

AccessConstructor and Description
public
TimeArrayTimeZoneRule(String
The time zone name.
name
,
int
The UTC 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
,
long[]
The start times in milliseconds since the base time (January 1, 1970, 00:00:00).
startTimes
,
int
The time type of the start times, which is one of DataTimeRule.WALL_TIME, STANDARD_TIME and UTC_TIME.
timeType
)

Constructs a TimeArrayTimeZoneRule with 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 TypeMethod and Description
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.
prevOffset
,
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.
prevOffset
,
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 long[]

Returns:

An array of the start times in milliseconds since the base time (January 1, 1970, 00:00:00 GMT).
getStartTimes
()

Gets the array of start times used by this rule.

public int

Returns:

The time type used of the start times used by this rule.
getTimeType
()

Gets the time type of the start times used by this rule.

private long
getUTC(long time, int raw, int dst)

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 TimeArrayTimeZoneRule object.
Inherited from com.ibm.icu.util.TimeZoneRule:
getDSTSavingsgetNamegetRawOffset

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

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

startTimesback to summary
private final long[] startTimes
timeTypeback to summary
private final int timeType

Constructor Detail

TimeArrayTimeZoneRuleback to summary
public TimeArrayTimeZoneRule(String name, int rawOffset, int dstSavings, long[] startTimes, int timeType)

Constructs a TimeArrayTimeZoneRule with 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:String

The time zone name.

rawOffset:int

The UTC 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.

startTimes:long[]

The start times in milliseconds since the base time (January 1, 1970, 00:00:00).

timeType:int

The time type of the start times, which is one of DataTimeRule.WALL_TIME, STANDARD_TIME and UTC_TIME.

ICU Status
Stable since ICU 3.8.

Method Detail

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 prevOffset, 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.

prevOffset: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 prevOffset, 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.

prevOffset: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.
getStartTimesback to summary
public long[] getStartTimes()

Gets the array of start times used by this rule.

Returns:long[]

An array of the start times in milliseconds since the base time (January 1, 1970, 00:00:00 GMT).

ICU Status
Stable since ICU 3.8.
getTimeTypeback to summary
public int getTimeType()

Gets the time type of the start times used by this rule. The return value is either DateTimeRule.WALL_TIME or DateTimeRule.STANDARD_TIME or DateTimeRule.UTC_TIME.

Returns:int

The time type used of the start times used by this rule.

ICU Status
Stable since ICU 3.8.
getUTCback to summary
private long getUTC(long time, int raw, int dst)
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 TimeArrayTimeZoneRule 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 TimeArrayTimeZoneRule 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.