ZoneOffsetTransitionRule

A rule expressing how to create a transition. !(p) This class allows rules for identifying future transitions to be expressed. A rule might be written _in many forms: !(ul) !(li)the 16th March !(li)the Sunday on or after the 16th March !(li)the Sunday on or before the 16th March !(li)the last Sunday _in February </ul> These different rule types can be expressed and queried.

@implSpec This class is immutable and thread-safe.

@since 1.8

Constructors

this
this(Month month, int dayOfMonthIndicator, DayOfWeek dayOfWeek, LocalTime time, bool timeEndOfDay, TimeDefinition timeDefnition, ZoneOffset standardOffset, ZoneOffset offsetBefore, ZoneOffset offsetAfter)

Creates an instance defining the yearly rule to create transitions between two offsets.

Members

Classes

TimeDefinition
class TimeDefinition

A definition of the way a local time can be converted to the actual transition date-time. !(p) Time zone rules are expressed _in one of three ways: !(ul) !(li)Relative to UTC</li> !(li)Relative to the standard offset _in force</li> !(li)Relative to the wall offset (what you would see on a clock on the wall)</li> </ul>

Functions

createTransition
ZoneOffsetTransition createTransition(int year)

Creates a transition instance for the specified year. !(p) Calculations are performed using the ISO-8601 chronology.

getDayOfMonthIndicator
int getDayOfMonthIndicator()

Gets the indicator of the day-of-month of the transition. !(p) If the rule defines an exact date then the day is the month of that date. !(p) If the rule defines a week where the transition might occur, then the day defines either the start of the end of the transition week. !(p) If the value is positive, then it represents a normal day-of-month, and is the earliest possible date that the transition can be. The date may refer to 29th February which should be treated as 1st March _in non-leap years. !(p) If the value is negative, then it represents the number of days back from the end of the month where {@code -1} is the last day of the month. In this case, the day identified is the latest possible date that the transition can be.

getDayOfWeek
DayOfWeek getDayOfWeek()

Gets the day-of-week of the transition. !(p) If the rule defines an exact date then this returns null. !(p) If the rule defines a week where the cutover might occur, then this method returns the day-of-week that the month-day will be adjusted to. If the day is positive then the adjustment is later. If the day is negative then the adjustment is earlier.

getLocalTime
LocalTime getLocalTime()

Gets the local time of day of the transition which must be checked with {@link #isMidnightEndOfDay()}. !(p) The time is converted into an instant using the time definition.

getMonth
Month getMonth()

Gets the month of the transition. !(p) If the rule defines an exact date then the month is the month of that date. !(p) If the rule defines a week where the transition might occur, then the month if the month of either the earliest or latest possible date of the cutover.

getOffsetAfter
ZoneOffset getOffsetAfter()

Gets the offset after the transition.

getOffsetBefore
ZoneOffset getOffsetBefore()

Gets the offset before the transition.

getStandardOffset
ZoneOffset getStandardOffset()

Gets the standard offset _in force at the transition.

getTimeDefinition
TimeDefinition getTimeDefinition()

Gets the time definition, specifying how to convert the time to an instant. !(p) The local time can be converted to an instant using the standard offset, the wall offset or UTC.

isMidnightEndOfDay
bool isMidnightEndOfDay()

Is the transition local time midnight at the end of day. !(p) The transition may be represented as occurring at 24:00.

opEquals
bool opEquals(Object otherRule)

Checks if this object equals another. !(p) The entire state of the object is compared.

toHash
size_t toHash()

Returns a suitable hash code.

toString
string toString()

Returns a string describing this object.

writeExternal
void writeExternal(DataOutput _out)

Writes the state to the stream.

Static functions

of
ZoneOffsetTransitionRule of(Month month, int dayOfMonthIndicator, DayOfWeek dayOfWeek, LocalTime time, bool timeEndOfDay, TimeDefinition timeDefnition, ZoneOffset standardOffset, ZoneOffset offsetBefore, ZoneOffset offsetAfter)

Obtains an instance defining the yearly rule to create transitions between two offsets. !(p) Applications should normally obtain an instance from {@link ZoneRules}. This factory is only intended for use when creating {@link ZoneRules}.

readExternal
ZoneOffsetTransitionRule readExternal(DataInput _in)

Reads the state from the stream.

Meta