Class DateTimeZoneBuilder.PrecalculatedZone

java.lang.Object
org.joda.time.DateTimeZone
org.joda.time.tz.DateTimeZoneBuilder.PrecalculatedZone
All Implemented Interfaces:
Serializable
Enclosing class:
DateTimeZoneBuilder

private static final class DateTimeZoneBuilder.PrecalculatedZone extends DateTimeZone
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • iTransitions

      private final long[] iTransitions
    • iWallOffsets

      private final int[] iWallOffsets
    • iStandardOffsets

      private final int[] iStandardOffsets
    • iNameKeys

      private final String[] iNameKeys
    • iTailZone

      private final DateTimeZoneBuilder.DSTZone iTailZone
  • Constructor Details

    • PrecalculatedZone

      private PrecalculatedZone(String id, long[] transitions, int[] wallOffsets, int[] standardOffsets, String[] nameKeys, DateTimeZoneBuilder.DSTZone tailZone)
      Constructor used ONLY for valid input, loaded via static methods.
  • Method Details

    • readFrom

      Throws:
      IOException
    • create

      Factory to create instance from builder.
      Parameters:
      id - the zone id
      outputID - true if the zone id should be output
      transitions - the list of Transition objects
      tailZone - optional zone for getting info beyond precalculated tables
    • getNameKey

      public String getNameKey(long instant)
      Description copied from class: DateTimeZone
      Returns a non-localized name that is unique to this time zone. It can be combined with id to form a unique key for fetching localized names.
      Specified by:
      getNameKey in class DateTimeZone
      Parameters:
      instant - milliseconds from 1970-01-01T00:00:00Z to get the name for
      Returns:
      name key or null if id should be used for names
    • getOffset

      public int getOffset(long instant)
      Description copied from class: DateTimeZone
      Gets the millisecond offset to add to UTC to get local time.

      This returns the actual offset from UTC for the zone at the specified instant. If the method is called with a different instant, the offset returned may be different as a result of daylight saving or other government rule changes.

      Specified by:
      getOffset in class DateTimeZone
      Parameters:
      instant - milliseconds from 1970-01-01T00:00:00Z to get the offset for
      Returns:
      the millisecond offset to add to UTC to get local time
    • getStandardOffset

      public int getStandardOffset(long instant)
      Description copied from class: DateTimeZone
      Gets the raw millisecond offset to add to UTC.

      This should be treated as an implementation detail. End-users should use DateTimeZone.getOffset(long).

      This returns the raw offset from UTC for the zone at the specified instant, effectively ignoring DST. If the method is called with a different instant, the offset returned may be different as a result of government rule changes.

      This method should be named getRawOffset() but cannot be renamed for compatibility reasons.

      Specified by:
      getStandardOffset in class DateTimeZone
      Parameters:
      instant - milliseconds from 1970-01-01T00:00:00Z to get the offset for
      Returns:
      the millisecond offset to add to UTC to get local time
    • isFixed

      public boolean isFixed()
      Description copied from class: DateTimeZone
      Returns true if this time zone has no transitions.
      Specified by:
      isFixed in class DateTimeZone
      Returns:
      true if no transitions
    • nextTransition

      public long nextTransition(long instant)
      Description copied from class: DateTimeZone
      Advances the given instant to where the time zone offset or name changes. If the instant returned is exactly the same as passed in, then no changes occur after the given instant.
      Specified by:
      nextTransition in class DateTimeZone
      Parameters:
      instant - milliseconds from 1970-01-01T00:00:00Z
      Returns:
      milliseconds from 1970-01-01T00:00:00Z
    • previousTransition

      public long previousTransition(long instant)
      Description copied from class: DateTimeZone
      Retreats the given instant to where the time zone offset or name changes. If the instant returned is exactly the same as passed in, then no changes occur before the given instant.
      Specified by:
      previousTransition in class DateTimeZone
      Parameters:
      instant - milliseconds from 1970-01-01T00:00:00Z
      Returns:
      milliseconds from 1970-01-01T00:00:00Z
    • equals

      public boolean equals(Object obj)
      Description copied from class: DateTimeZone
      Compare this datetime zone with another.
      Specified by:
      equals in class DateTimeZone
      Parameters:
      obj - the object to compare with
      Returns:
      true if equal, based on the ID and all internal rules
    • hashCode

      public int hashCode()
      Description copied from class: DateTimeZone
      Gets a hash code compatible with equals.
      Overrides:
      hashCode in class DateTimeZone
      Returns:
      suitable hashcode
    • writeTo

      public void writeTo(DataOutput out) throws IOException
      Throws:
      IOException
    • isCachable

      public boolean isCachable()