Save This Page
Home » openjdk-7 » sun » util » calendar » [javadoc | source]
public class: ZoneInfo [javadoc | source]

All Implemented Interfaces:
    java$io$Serializable, Cloneable

ZoneInfo is an implementation subclass of TimeZone that represents GMT offsets and daylight saving time transitions of a time zone.

The daylight saving time transitions are described in the transitions table consisting of a chronological sequence of transitions of GMT offset and/or daylight saving time changes. Since all transitions are represented in UTC, in theory, ZoneInfo can be used with any calendar systems except for the getOffset method that takes Gregorian calendar date fields.

This table covers transitions from 1900 until 2037 (as of version 1.4), Before 1900, it assumes that there was no daylight saving time and the getOffset methods always return the #getRawOffset value. No Local Mean Time is supported. If a specified date is beyond the transition table and this time zone is supposed to observe daylight saving time in 2037, it delegates operations to a SimpleTimeZone object created using the daylight saving time schedule as of 2037.

The date items, transitions, GMT offset(s), etc. are read from a database file. See ZoneInfoFile for details.

Fields inherited from java.util.TimeZone:
SHORT,  LONG,  serialVersionUID,  NO_TIMEZONE,  GMT_ID,  $assertionsDisabled
 public ZoneInfo() 
 public ZoneInfo(String ID,
    int rawOffset) 
    A Constructor for CustomID.
 ZoneInfo(String ID,
    int rawOffset,
    int dstSavings,
    int checksum,
    long[] transitions,
    int[] offsets,
    int[] simpleTimeZoneParams,
    boolean willGMTOffsetChange) 
    Constructs a ZoneInfo instance.
    ID - time zone name
    rawOffset - GMT offset in milliseconds
    dstSavings - daylight saving value in milliseconds or 0 (zero) if this time zone doesn't observe Daylight Saving Time.
    checksum - CRC32 value with all transitions table entry values
    transitions - transition table
    offsets - offset value table
    simpleTimeZoneParams - parameter values for constructing SimpleTimeZone
    willGMTOffsetChange - the value of willGMTOffsetChange
Method from sun.util.calendar.ZoneInfo Summary:
clone,   equals,   getAliasTable,   getAvailableIDs,   getAvailableIDs,   getDSTSavings,   getLastRuleInstance,   getOffset,   getOffset,   getOffsets,   getOffsetsByStandard,   getOffsetsByWall,   getRawOffset,   getTimeZone,   hasSameRules,   hashCode,   inDaylightTime,   isDirty,   observesDaylightTime,   setRawOffset,   toString,   useDaylightTime
Methods from java.util.TimeZone:
clone,   getAvailableIDs,   getAvailableIDs,   getDSTSavings,   getDefault,   getDefaultRef,   getDisplayName,   getDisplayName,   getDisplayName,   getDisplayName,   getID,   getOffset,   getOffset,   getOffsets,   getRawOffset,   getTimeZone,   hasSameRules,   inDaylightTime,   setDefault,   setID,   setRawOffset,   useDaylightTime
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from sun.util.calendar.ZoneInfo Detail:
 public Object clone() 
    Returns a copy of this ZoneInfo.
 public boolean equals(Object obj) 
    Compares the equity of two ZoneInfo objects.
 public static synchronized Map<String, String> getAliasTable() 
    Returns a Map from alias time zone IDs to their standard time zone IDs.
 public static String[] getAvailableIDs() 
    Gets all available IDs supported in the Java run-time.
 public static String[] getAvailableIDs(int rawOffset) 
    Gets all available IDs that have the same value as the specified raw GMT offset.
 public int getDSTSavings() 
    Returns the amount of time in milliseconds that the clock is advanced during daylight saving time is in effect in its last daylight saving time rule.
 public SimpleTimeZone getLastRuleInstance() 
    Returns a SimpleTimeZone object that represents the last known daylight saving time rules.
 public int getOffset(long date) 
    Returns the difference in milliseconds between local time and UTC of given time, taking into account both the raw offset and the effect of daylight savings.
 public int getOffset(int era,
    int year,
    int month,
    int day,
    int dayOfWeek,
    int milliseconds) 
    Returns the difference in milliseconds between local time and UTC, taking into account both the raw offset and the effect of daylight savings, for the specified date and time. This method assumes that the start and end month are distinct. This method assumes a Gregorian calendar for calculations.

    Note: In general, clients should use Calendar.get(ZONE_OFFSET) + Calendar.get(DST_OFFSET) instead of calling this method.

 public int getOffsets(long utc,
    int[] offsets) 
 public int getOffsetsByStandard(long standard,
    int[] offsets) 
 public int getOffsetsByWall(long wall,
    int[] offsets) 
 public int getRawOffset() 
    Returns the GMT offset of the current date. This GMT offset value is not modified during Daylight Saving Time.
 public static TimeZone getTimeZone(String ID) 
    Gets the ZoneInfo for the given ID.
 public boolean hasSameRules(TimeZone other) 
    Returns true if this zone has the same raw GMT offset value and transition table as another zone info. If the specified TimeZone object is not a ZoneInfo instance, this method returns true if the specified TimeZone object has the same raw GMT offset value with no daylight saving time.
 public int hashCode() 
    Returns a hash code value calculated from the GMT offset and transitions.
 public boolean inDaylightTime(Date date) 
    Queries if the specified date is in Daylight Saving Time.
 public boolean isDirty() 
 public boolean observesDaylightTime() 
 public synchronized  void setRawOffset(int offsetMillis) 
    Sets the base time zone offset from GMT. This operation modifies all the transitions of this ZoneInfo object, including historical ones, if applicable.
 public String toString() 
    Returns a string representation of this time zone.
 public boolean useDaylightTime() 
    Queries if this time zone uses Daylight Saving Time in the last known rule.