Class TimeZone.ConstantZone

java.lang.Object
com.ibm.icu.util.TimeZone
com.ibm.icu.util.TimeZone.ConstantZone
All Implemented Interfaces:
Freezable<TimeZone>, Serializable, Cloneable
Enclosing class:
TimeZone

private static final class TimeZone.ConstantZone extends TimeZone
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • rawOffset

      private int rawOffset
    • isFrozen

      private transient volatile boolean isFrozen
  • Constructor Details

    • ConstantZone

      private ConstantZone(int rawOffset, String ID)
  • Method Details

    • getOffset

      public int getOffset(int era, int year, int month, int day, int dayOfWeek, int milliseconds)
      Description copied from class: TimeZone
      Gets the time zone offset, for current date, modified in case of daylight savings. This is the offset to add to UTC to get local time.
      Specified by:
      getOffset in class TimeZone
      Parameters:
      era - the era of the given date.
      year - the year in the given date.
      month - the month in the given date. Month is 0-based. e.g., 0 for January.
      day - the day-in-month of the given date.
      dayOfWeek - the day-of-week of the given date.
      milliseconds - the millis in day in standard local time.
      Returns:
      the offset to add to GMT to get local time.
    • setRawOffset

      public void setRawOffset(int offsetMillis)
      Description copied from class: TimeZone
      Sets the base time zone offset to GMT. This is the offset to add to UTC to get local time.
      Specified by:
      setRawOffset in class TimeZone
      Parameters:
      offsetMillis - the given base time zone offset to GMT.
    • getRawOffset

      public int getRawOffset()
      Description copied from class: TimeZone
      Gets unmodified offset, NOT modified in case of daylight savings. This is the offset to add to UTC to get local time.
      Specified by:
      getRawOffset in class TimeZone
      Returns:
      the unmodified offset to add to UTC to get local time.
    • useDaylightTime

      public boolean useDaylightTime()
      Description copied from class: TimeZone
      Queries if this time zone uses daylight savings time.
      Specified by:
      useDaylightTime in class TimeZone
      Returns:
      true if this time zone uses daylight savings time, false, otherwise.

      Note:The default implementation of ICU TimeZone uses the tz database, which supports historic rule changes, for system time zones. With the implementation, there are time zones that used daylight savings time in the past, but no longer used currently. For example, Asia/Tokyo has never used daylight savings time since 1951. Most clients would expect that this method to return false for such case. The default implementation of this method returns true when the time zone uses daylight savings time in the current (Gregorian) calendar year.

    • inDaylightTime

      public boolean inDaylightTime(Date date)
      Description copied from class: TimeZone
      Queries if the given date is in daylight savings time in this time zone.
      Specified by:
      inDaylightTime in class TimeZone
      Parameters:
      date - the given Date.
      Returns:
      true if the given date is in daylight savings time, false, otherwise.
    • isFrozen

      public boolean isFrozen()
      Description copied from class: TimeZone
      Determines whether the object has been frozen or not.
      Specified by:
      isFrozen in interface Freezable<TimeZone>
      Overrides:
      isFrozen in class TimeZone
    • freeze

      public TimeZone freeze()
      Description copied from class: TimeZone
      Freezes the object.
      Specified by:
      freeze in interface Freezable<TimeZone>
      Overrides:
      freeze in class TimeZone
      Returns:
      the object itself.
    • cloneAsThawed

      public TimeZone cloneAsThawed()
      Description copied from class: TimeZone
      Provides for the clone operation. Any clone is initially unfrozen.
      Specified by:
      cloneAsThawed in interface Freezable<TimeZone>
      Overrides:
      cloneAsThawed in class TimeZone