Lines Matching defs:TimeZone

3  * @(#)TimeZone.java    1.51 00/01/19
32 * <strong>[icu enhancement]</strong> ICU's replacement for {@link java.util.TimeZone}.&nbsp;Methods, fields, and other functionality specific to ICU are labeled '<strong>[icu]</strong>'.
34 * <p><code>TimeZone</code> represents a time zone offset, and also computes daylight
37 * <p>Typically, you get a <code>TimeZone</code> using {@link #getDefault()}
38 * which creates a <code>TimeZone</code> based on the time zone where the program
40 * creates a <code>TimeZone</code> object based on Japanese Standard Time.
42 * <p>You can also get a <code>TimeZone</code> using {@link #getTimeZone(String)}
45 * U.S. Pacific Time <code>TimeZone</code> object with:
49 * TimeZone tz = TimeZone.getTimeZone("America/Los_Angeles");
55 * supported ID to get a <code>TimeZone</code>.
67 * time zone ID. The <code>TimeZone</code> that is returned
71 * time zone ID to create a TimeZone representing 14 hours ahead
88 abstract public class TimeZone implements Serializable, Cloneable, Freezable<TimeZone> {
92 private static final Logger LOGGER = Logger.getLogger("android.icu.util.TimeZone");
101 public TimeZone() {
105 * Constructing a TimeZone with the given time zone ID.
112 protected TimeZone(String ID) {
120 * <strong>[icu]</strong> A time zone implementation type indicating ICU's own TimeZone used by
127 * <strong>[icu]</strong> A time zone implementation type indicating the {@link java.util.TimeZone}
205 * {@link TimeZone#getTimeZone(String)} returns a mutable clone of this
211 public static final TimeZone UNKNOWN_ZONE = new ConstantZone(0, UNKNOWN_ZONE_ID).freeze();
216 public static final TimeZone GMT_ZONE = new ConstantZone(0, GMT_ZONE_ID).freeze();
220 * {@link TimeZone#getAvailableIDs(SystemTimeZoneType, String, Integer)}
281 * Gregorian calendar. The default implementation in the TimeZone
361 throw new UnsupportedOperationException("Attempt to modify a frozen TimeZone instance.");
560 * If an underlying TimeZone implementation subclass supports
578 * ICU TimeZone uses the tz database, which supports historic
596 * <strong>Note:</strong> This method was added for {@link java.util.TimeZone} compatibility
597 * support. The {@link java.util.TimeZone#useDaylightTime()} method only checks the last known
599 * {@link java.util.TimeZone} added <code>observesDaylightTime()</code> to resolve the issue.
604 * ICU's TimeZone subclass implementations override this method to support the same behavior
605 * with {@link java.util.TimeZone#observesDaylightTime()}. Unlike {@link #useDaylightTime()},
628 * Gets the <code>TimeZone</code> for the given ID.
630 * @param ID the ID for a <code>TimeZone</code>, such as "America/Los_Angeles",
634 * @return the specified <code>TimeZone</code>, or a mutable clone of the UNKNOWN_ZONE
638 public static TimeZone getTimeZone(String ID) {
643 * Gets the <code>TimeZone</code> for the given ID. The instance of <code>TimeZone</code>
648 * @param ID the ID for a <code>TimeZone</code>, such as "America/Los_Angeles",
652 * @return the specified <code>TimeZone</code>, or the UNKNOWN_ZONE
656 public static TimeZone getFrozenTimeZone(String ID) {
661 * Gets the <code>TimeZone</code> for the given ID and the timezone type.
662 * @param ID the ID for a <code>TimeZone</code>, such as "America/Los_Angeles", or a
667 * @return the specified <code>TimeZone</code>, or a mutable clone of the UNKNOWN_ZONE if the given ID
671 public static TimeZone getTimeZone(String ID, int type) {
676 * Gets the <code>TimeZone</code> for the given ID and the timezone type.
680 * @return the specified <code>TimeZone</code> or UNKNOWN_ZONE if the given ID
683 private static TimeZone getTimeZone(String ID, int type, boolean frozen) {
684 TimeZone result;
694 * user wants, but at least is a functioning TimeZone object.
758 * Return a new String array containing all system TimeZone IDs
760 * <code>get()</code> to construct the corresponding TimeZone
773 * Return a new String array containing all system TimeZone IDs
775 * <code>get()</code> to construct the corresponding TimeZone
789 * Return a new String array containing all system TimeZone IDs.
791 * <code>get()</code> to construct the corresponding TimeZone
793 * @return an array of all system TimeZone IDs
841 * Gets the default <code>TimeZone</code> for this host.
842 * The source of the default <code>TimeZone</code>
844 * @return a default <code>TimeZone</code>.
846 public static TimeZone getDefault() {
848 synchronized(TimeZone.class) {
853 java.util.TimeZone temp = java.util.TimeZone.getDefault();
863 // ICU TimeZone.setDefault() not supported on Android.
867 * from {@link java.util.TimeZone}.
876 * Sets the <code>TimeZone</code> that is
883 public static synchronized void setDefault(TimeZone tz) {
885 java.util.TimeZone jdkZone = null;
889 // Keep java.util.TimeZone default in sync so java.util.Date
895 // zone offset/dst saving in JDK TimeZone,
896 // wrapping ICU TimeZone with JDK TimeZone will
899 // getDSTSavings() when the instance of JDK TimeZone
900 // is not an instance of JDK internal TimeZone subclass
903 jdkZone = java.util.TimeZone.getTimeZone(icuID);
911 jdkZone = java.util.TimeZone.getTimeZone(icuID);
923 java.util.TimeZone.setDefault(jdkZone);
930 * @param other the <code>TimeZone</code> object to be compared with
934 public boolean hasSameRules(TimeZone other) {
956 return (ID.equals(((TimeZone)obj).ID));
1006 if (id.equals(TimeZone.UNKNOWN_ZONE_ID)) {
1008 canonicalID = TimeZone.UNKNOWN_ZONE_ID;
1174 public TimeZone freeze() {
1181 public TimeZone cloneAsThawed() {
1183 TimeZone other = (TimeZone) super.clone();
1193 * The string identifier of this <code>TimeZone</code>. This is a
1194 * programmatic identifier used internally to look up <code>TimeZone</code>
1205 private static volatile TimeZone defaultZone = null;
1208 * TimeZone implementation type
1213 * TimeZone implementation type initialization
1215 private static final String TZIMPL_CONFIG_KEY = "android.icu.util.TimeZone.DefaultTimeZoneType";
1227 * ConstantZone is a private TimeZone subclass dedicated for the two TimeZone class
1228 * constants - TimeZone.GMT_ZONE and TimeZone.UNKNOWN_ZONE. Previously, these zones
1230 * TimeZone's static methods (such as TimeZone.getDefault()) are called from multiple
1231 * threads at the same time, it causes a deadlock by TimeZone's static initializer
1232 * and SimpleTimeZone's static initializer. To avoid this issue, these TimeZone
1236 private static final class ConstantZone extends TimeZone {
1254 throw new UnsupportedOperationException("Attempt to modify a frozen TimeZone instance.");
1282 public TimeZone freeze() {
1288 public TimeZone cloneAsThawed() {