Lines Matching defs:TimeZone

2  * @(#)TimeZone.java    1.51 00/01/19
31 * {@icuenhanced java.util.TimeZone}.{@icu _usage_}
33 * <p><code>TimeZone</code> represents a time zone offset, and also computes daylight
36 * <p>Typically, you get a <code>TimeZone</code> using {@link #getDefault()}
37 * which creates a <code>TimeZone</code> based on the time zone where the program
39 * creates a <code>TimeZone</code> object based on Japanese Standard Time.
41 * <p>You can also get a <code>TimeZone</code> using {@link #getTimeZone(String)}
44 * U.S. Pacific Time <code>TimeZone</code> object with:
48 * TimeZone tz = TimeZone.getTimeZone("America/Los_Angeles");
54 * supported ID to get a <code>TimeZone</code>.
66 * time zone ID. The <code>TimeZone</code> that is returned
70 * time zone ID to create a TimeZone representing 14 hours ahead
83 * JDK <code>TimeZone</code> as the time zone implementation. The TimeZone factory
84 * method <code>getTimeZone</code> creates an instance of ICU's own <code>TimeZone</code>
93 * # The default TimeZone implementation type used by the ICU TimeZone
96 * com.ibm.icu.util.TimeZone.DefaultTimeZoneType = ICU
101 * <code>TimeZone</code> class is loaded, the initialization code checks if the property
102 * <code>com.ibm.icu.util.TimeZone.DefaultTimeZoneType=xxx</code> is defined by the system
114 abstract public class TimeZone implements Serializable, Cloneable, Freezable<TimeZone> {
118 private static final Logger LOGGER = Logger.getLogger("com.ibm.icu.util.TimeZone");
128 public TimeZone() {
132 * Constructing a TimeZone with the given time zone ID.
138 protected TimeZone(String ID) {
146 * {@icu} A time zone implementation type indicating ICU's own TimeZone used by
153 * {@icu} A time zone implementation type indicating JDK TimeZone used by
241 * {@link TimeZone#getTimeZone(String)} returns a mutable clone of this
249 public static final TimeZone UNKNOWN_ZONE = new ConstantZone(0, UNKNOWN_ZONE_ID).freeze();
256 public static final TimeZone GMT_ZONE = new ConstantZone(0, GMT_ZONE_ID).freeze();
260 * {@link TimeZone#getAvailableIDs(SystemTimeZoneType, String, Integer)}
328 * Gregorian calendar. The default implementation in the TimeZone
414 throw new UnsupportedOperationException("Attempt to modify a frozen TimeZone instance.");
619 * If an underlying TimeZone implementation subclass supports
638 * ICU TimeZone uses the tz database, which supports historic
665 * ICU's TimeZone subclass implementations override this method to support the same behavior
691 * Gets the <code>TimeZone</code> for the given ID.
693 * @param ID the ID for a <code>TimeZone</code>, such as "America/Los_Angeles",
697 * @return the specified <code>TimeZone</code>, or a mutable clone of the UNKNOWN_ZONE
702 public static TimeZone getTimeZone(String ID) {
707 * Gets the <code>TimeZone</code> for the given ID. The instance of <code>TimeZone</code>
712 * @param ID the ID for a <code>TimeZone</code>, such as "America/Los_Angeles",
716 * @return the specified <code>TimeZone</code>, or the UNKNOWN_ZONE
721 public static TimeZone getFrozenTimeZone(String ID) {
726 * Gets the <code>TimeZone</code> for the given ID and the timezone type.
727 * @param ID the ID for a <code>TimeZone</code>, such as "America/Los_Angeles", or a
732 * @return the specified <code>TimeZone</code>, or a mutable clone of the UNKNOWN_ZONE if the given ID
737 public static TimeZone getTimeZone(String ID, int type) {
742 * Gets the <code>TimeZone</code> for the given ID and the timezone type.
746 * @return the specified <code>TimeZone</code> or UNKNOWN_ZONE if the given ID
749 private static TimeZone getTimeZone(String ID, int type, boolean frozen) {
750 TimeZone result;
760 * user wants, but at least is a functioning TimeZone object.
826 * Return a new String array containing all system TimeZone IDs
828 * <code>get()</code> to construct the corresponding TimeZone
843 * Return a new String array containing all system TimeZone IDs
845 * <code>get()</code> to construct the corresponding TimeZone
861 * Return a new String array containing all system TimeZone IDs.
863 * <code>get()</code> to construct the corresponding TimeZone
865 * @return an array of all system TimeZone IDs
917 * Gets the default <code>TimeZone</code> for this host.
918 * The source of the default <code>TimeZone</code>
920 * @return a default <code>TimeZone</code>.
923 public static TimeZone getDefault() {
925 synchronized(TimeZone.class) {
930 java.util.TimeZone temp = java.util.TimeZone.getDefault();
940 * Sets the <code>TimeZone</code> that is
947 public static synchronized void setDefault(TimeZone tz) {
949 java.util.TimeZone jdkZone = null;
953 // Keep java.util.TimeZone default in sync so java.util.Date
959 // zone offset/dst saving in JDK TimeZone,
960 // wrapping ICU TimeZone with JDK TimeZone will
963 // getDSTSavings() when the instance of JDK TimeZone
964 // is not an instance of JDK internal TimeZone subclass
967 jdkZone = java.util.TimeZone.getTimeZone(icuID);
975 jdkZone = java.util.TimeZone.getTimeZone(icuID);
987 java.util.TimeZone.setDefault(jdkZone);
994 * @param other the <code>TimeZone</code> object to be compared with
999 public boolean hasSameRules(TimeZone other) {
1023 return (ID.equals(((TimeZone)obj).ID));
1078 if (id.equals(TimeZone.UNKNOWN_ZONE_ID)) {
1080 canonicalID = TimeZone.UNKNOWN_ZONE_ID;
1254 public TimeZone freeze() {
1262 public TimeZone cloneAsThawed() {
1264 TimeZone other = (TimeZone) super.clone();
1274 * The string identifier of this <code>TimeZone</code>. This is a
1275 * programmatic identifier used internally to look up <code>TimeZone</code>
1286 private static volatile TimeZone defaultZone = null;
1289 * TimeZone implementation type
1294 * TimeZone implementation type initialization
1296 private static final String TZIMPL_CONFIG_KEY = "com.ibm.icu.util.TimeZone.DefaultTimeZoneType";
1308 * ConstantZone is a private TimeZone subclass dedicated for the two TimeZone class
1309 * constants - TimeZone.GMT_ZONE and TimeZone.UNKNOWN_ZONE. Previously, these zones
1311 * TimeZone's static methods (such as TimeZone.getDefault()) are called from multiple
1312 * threads at the same time, it causes a deadlock by TimeZone's static initializer
1313 * and SimpleTimeZone's static initializer. To avoid this issue, these TimeZone
1317 private static final class ConstantZone extends TimeZone {
1335 throw new UnsupportedOperationException("Attempt to modify a frozen TimeZone instance.");
1363 public TimeZone freeze() {
1369 public TimeZone cloneAsThawed() {