Package

org.threeten.bp

zone

Permalink

package zone

Support for time-zones and their rules.

Daylight Saving Time and Time-Zones are concepts used by Governments to alter local time. This package provides support for time-zones, their rules and the resulting gaps and overlaps in the local time-line typically caused by Daylight Saving Time.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. zone
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. final class Ser extends Externalizable

    Permalink

    Creates an instance for serialization.

    Creates an instance for serialization.

    Annotations
    @SerialVersionUID()
  2. class ServiceLoaderZoneRulesInitializer extends ZoneRulesInitializer

    Permalink

    Try to load time zone rules from implementations provided by ServiceLoader.

  3. final class StandardZoneRules extends ZoneRules with Serializable

    Permalink

    The rules describing how the zone offset varies through the year and historically.

    The rules describing how the zone offset varies through the year and historically.

    This class is used by the TZDB time-zone rules.

    Specification for implementors

    This class is immutable and thread-safe.

    Annotations
    @SerialVersionUID()
  4. final class TzdbZoneRulesCompiler extends AnyRef

    Permalink

    A builder that can read the TZDB time-zone files and build ZoneRules instances.

    A builder that can read the TZDB time-zone files and build ZoneRules instances.

    Specification for implementors

    This class is a mutable builder. A new instance must be created for each compile.

  5. final class TzdbZoneRulesProvider extends ZoneRulesProvider

    Permalink

    Loads time-zone rules for 'TZDB'.

    Loads time-zone rules for 'TZDB'.

    This class is public for the service loader to access.

    Specification for implementors

    This class is immutable and thread-safe.

    Exceptions thrown

    ZoneRulesException if unable to load

  6. final class ZoneOffsetTransition extends Ordered[ZoneOffsetTransition] with Serializable

    Permalink

    Creates an instance defining a transition between two offsets.

    Creates an instance defining a transition between two offsets.

    Annotations
    @SerialVersionUID()
  7. final class ZoneOffsetTransitionRule extends Serializable

    Permalink

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

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

    Annotations
    @SerialVersionUID()
    Exceptions thrown

    IllegalArgumentException if the end of day flag is true when the time is not midnight

  8. abstract class ZoneRules extends AnyRef

    Permalink

  9. class ZoneRulesBuilder extends AnyRef

    Permalink

    A mutable builder used to create all the rules for a historic time-zone.

    A mutable builder used to create all the rules for a historic time-zone.

    The rules of a time-zone describe how the offset changes over time. The rules are created by building windows on the time-line within which the different rules apply. The rules may be one of two kinds:

    • Fixed savings - A single fixed amount of savings from the standard offset will apply.
    • Rules - A set of one or more rules describe how daylight savings changes during the window.
    Specification for implementors

    This class is a mutable builder used to create zone instances. It must only be used from a single thread. The created instances are immutable and thread-safe.

    Constructs an instance of the builder that can be used to create zone rules.

    The builder is used by adding one or more windows representing portions of the time-line. The standard offset from UTC/Greenwich will be constant within a window, although two adjacent windows can have the same standard offset.

    Within each window, there can either be a fixed savings amount or a list of rules.

  10. class ZoneRulesException extends DateTimeException

    Permalink

    Thrown to indicate a problem with time-zone configuration.

    Thrown to indicate a problem with time-zone configuration.

    This exception is used to indicate a problems with the configured time-zone rules.

    Specification for implementors

    This class is intended for use in a single thread.

    Constructs a new date-time exception with the specified message and cause.

    Annotations
    @SerialVersionUID()
  11. abstract class ZoneRulesInitializer extends AnyRef

    Permalink

    Controls how the time-zone rules are initialized.

    Controls how the time-zone rules are initialized.

    The default behavior is to use ServiceLoader to find instances of ZoneRulesProvider. Use the #setInitializer(ZoneRulesInitializer) method to replace this behavior. The initializer instance must perform the work of creating the ZoneRulesProvider within the #initializeProviders() method to ensure that the provider is not initialized too early.

    The initializer must be set before class loading of any other ThreeTen-Backport class to have any effect!

    This class has been added primarily for the benefit of Android.

  12. abstract class ZoneRulesProvider extends AnyRef

    Permalink

    Provider of time-zone rules to the system.

    Provider of time-zone rules to the system.

    This class manages the configuration of time-zone rules. The static methods provide the public API that can be used to manage the providers. The abstract methods provide the SPI that allows rules to be provided.

    Rules are looked up primarily by zone ID, as used by ZoneId. Only zone region IDs may be used, zone offset IDs are not used here.

    Time-zone rules are political, thus the data can change at any time. Each provider will provide the latest rules for each zone ID, but they may also provide the history of how the rules changed.

    Specification for implementors

    This interface is a service provider that can be called by multiple threads. Implementations must be immutable and thread-safe.

    Providers must ensure that once a rule has been seen by the application, the rule must continue to be available.

    Many systems would like to update time-zone rules dynamically without stopping the JVM. When examined in detail, this is a complex problem. Providers may choose to handle dynamic updates, however the default provider does not.

Value Members

  1. object StandardZoneRules extends Serializable

    Permalink
    Annotations
    @SerialVersionUID()
  2. object TzdbZoneRulesCompiler

    Permalink
  3. object ZoneMap

    Permalink
  4. object ZoneOffsetTransition extends Serializable

    Permalink

    A transition between two offsets caused by a discontinuity in the local time-line.

    A transition between two offsets caused by a discontinuity in the local time-line.

    A transition between two offsets is normally the result of a daylight savings cutover. The discontinuity is normally a gap in spring and an overlap in autumn. ZoneOffsetTransition models the transition between the two offsets.

    Gaps occur where there are local date-times that simply do not not exist. An example would be when the offset changes from +03:00 to +04:00. This might be described as 'the clocks will move forward one hour tonight at 1am'.

    Overlaps occur where there are local date-times that exist twice. An example would be when the offset changes from +04:00 to +03:00. This might be described as 'the clocks will move back one hour tonight at 2am'.

    Specification for implementors

    This class is immutable and thread-safe.

    Annotations
    @SerialVersionUID()
  5. object ZoneOffsetTransitionRule extends Serializable

    Permalink

    A rule expressing how to create a transition.

    A rule expressing how to create a transition.

    This class allows rules for identifying future transitions to be expressed. A rule might be written in many forms:

    • the 16th March
    • the Sunday on or after the 16th March
    • the Sunday on or before the 16th March
    • the last Sunday in February

    These different rule types can be expressed and queried.

    Specification for implementors

    This class is immutable and thread-safe.

    Annotations
    @SerialVersionUID()
  6. object ZoneRules

    Permalink

    The rules defining how the zone offset varies for a single time-zone.

    The rules defining how the zone offset varies for a single time-zone.

    The rules model all the historic and future transitions for a time-zone. ZoneOffsetTransition is used for known transitions, typically historic. ZoneOffsetTransitionRule is used for future transitions that are based on the result of an algorithm.

    The rules are loaded via ZoneRulesProvider using a ZoneId. The same rules may be shared internally between multiple zone IDs.

    Serializing an instance of ZoneRules will store the entire set of rules. It does not store the zone ID as it is not part of the state of this object.

    A rule implementation may or may not store full information about historic and future transitions, and the information stored is only as accurate as that supplied to the implementation by the rules provider. Applications should treat the data provided as representing the best information available to the implementation of this rule.

    Specification for implementors

    The supplied implementations of this class are immutable and thread-safe.

  7. object ZoneRulesInitializer

    Permalink
  8. object ZoneRulesProvider

    Permalink

Inherited from AnyRef

Inherited from Any

Ungrouped