harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@apache.org
Subject svn commit: r350181 [121/198] - in /incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core: ./ depends/ depends/files/ depends/jars/ depends/libs/ depends/libs/linux.IA32/ depends/libs/win.IA32/ depends/oss/ depends/oss/linux.IA32/ depends/oss/win....
Date Thu, 01 Dec 2005 06:04:00 GMT
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/util/SortedMap.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/util/SortedMap.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/util/SortedMap.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/util/SortedMap.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,114 @@
+/* Copyright 1998, 2002 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.util;
+
+
+/**
+ * SortedMap is a Map where the iterators sequence in order of the sorted keys.
+ */
+public interface SortedMap extends Map {
+	
+	/**
+	 * Answers the Comparator used to compare elements in this SortedMap.
+	 * 
+	 * @return a Comparator or null if the natural order is used
+	 */
+	public Comparator comparator();
+
+	/**
+	 * Answer the first sorted key in this SortedMap.
+	 * 
+	 * @return the first sorted key
+	 * 
+	 * @exception NoSuchElementException
+	 *                when this SortedMap is empty
+	 */
+	public Object firstKey();
+
+	/**
+	 * Answers a <code>SortedMap</code> of the specified portion of this
+	 * <code>SortedMap</code> which contains keys less than the end key. Users
+	 * should be aware that the return value is actually backed by this
+	 * <code>SortedMap</code>. Hence any modifications made to one will be
+	 * immediately visible to the other.
+	 * 
+	 * @param endKey
+	 *            the end key
+	 * @return a submap where the keys are less than <code>endKey</code>
+	 * 
+	 * @exception ClassCastException
+	 *                when the class of the end key is inappropriate for this
+	 *                SubMap
+	 * @exception NullPointerException
+	 *                when the end key is null and this SortedMap does not
+	 *                support null keys
+	 */
+	public SortedMap headMap(Object endKey);
+
+	/**
+	 * Answers the last sorted key in this SortedMap.
+	 * 
+	 * @return the last sorted key
+	 * 
+	 * @exception NoSuchElementException
+	 *                when this SortedMap is empty
+	 */
+	public Object lastKey();
+
+	/**
+	 * Answers a SortedMap of the specified portion of this SortedMap which
+	 * contains keys greater or equal to the start key but less than the end
+	 * key. Users should be aware that the return value is actually backed by
+	 * this <code>SortedMap</code>. Hence any modifications made to one will
+	 * be immediately visible to the other.
+	 * 
+	 * @param startKey
+	 *            the start key
+	 * @param endKey
+	 *            the end key
+	 * @return a submap where the keys are greater or equal to
+	 *         <code>startKey</code> and less than <code>endKey</code>
+	 * 
+	 * @exception ClassCastException
+	 *                when the class of the start or end key is inappropriate
+	 *                for this SubMap
+	 * @exception NullPointerException
+	 *                when the start or end key is null and this SortedMap does
+	 *                not support null keys
+	 * @exception IllegalArgumentException
+	 *                when the start key is greater than the end key
+	 */
+	public SortedMap subMap(Object startKey, Object endKey);
+
+	/**
+	 * Answers a SortedMap of the specified portion of this SortedMap which
+	 * contains keys greater or equal to the start key. The returned SortedMap
+	 * is backed by this SortedMap so changes to one are reflected by the other.
+	 * 
+	 * @param startKey
+	 *            the start key
+	 * @return a submap where the keys are greater or equal to
+	 *         <code>startKey</code>
+	 * 
+	 * @exception ClassCastException
+	 *                when the class of the start key is inappropriate for this
+	 *                SubMap
+	 * @exception NullPointerException
+	 *                when the start key is null and this SortedMap does not
+	 *                support null keys
+	 */
+	public SortedMap tailMap(Object startKey);
+}

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/util/SortedSet.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/util/SortedSet.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/util/SortedSet.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/util/SortedSet.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,112 @@
+/* Copyright 1998, 2002 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.util;
+
+
+/**
+ * SortedSet is a Set which iterates its elements in sorted order.
+ */
+public interface SortedSet extends Set {
+	
+	/**
+	 * Answers the Comparator used to compare elements in this SortedSet.
+	 * 
+	 * @return a Comparator or null if the natural order is used
+	 */
+	public Comparator comparator();
+
+	/**
+	 * Answer the first sorted element in this SortedSet.
+	 * 
+	 * @return the first sorted element
+	 * 
+	 * @exception NoSuchElementException
+	 *                when this SortedSet is empty
+	 */
+	public Object first();
+
+	/**
+	 * Answers a SortedSet of the specified portion of this SortedSet which
+	 * contains elements less than the end element. The returned SortedSet is
+	 * backed by this SortedSet so changes to one are reflected by the other.
+	 * 
+	 * @param end
+	 *            the end element
+	 * @return a subset where the elements are less than <code>end</code>
+	 * 
+	 * @exception ClassCastException
+	 *                when the class of the end element is inappropriate for
+	 *                this SubSet
+	 * @exception NullPointerException
+	 *                when the end element is null and this SortedSet does not
+	 *                support null elements
+	 */
+	public SortedSet headSet(Object end);
+
+	/**
+	 * Answer the last sorted element in this SortedSet.
+	 * 
+	 * @return the last sorted element
+	 * 
+	 * @exception NoSuchElementException
+	 *                when this SortedSet is empty
+	 */
+	public Object last();
+
+	/**
+	 * Answers a SortedSet of the specified portion of this SortedSet which
+	 * contains elements greater or equal to the start element but less than the
+	 * end element. The returned SortedSet is backed by this SortedMap so
+	 * changes to one are reflected by the other.
+	 * 
+	 * @param start
+	 *            the start element
+	 * @param end
+	 *            the end element
+	 * @return a subset where the elements are greater or equal to
+	 *         <code>start</code> and less than <code>end</code>
+	 * 
+	 * @exception ClassCastException
+	 *                when the class of the start or end element is
+	 *                inappropriate for this SubSet
+	 * @exception NullPointerException
+	 *                when the start or end element is null and this SortedSet
+	 *                does not support null elements
+	 * @exception IllegalArgumentException
+	 *                when the start element is greater than the end element
+	 */
+	public SortedSet subSet(Object start, Object end);
+
+	/**
+	 * Answers a SortedSet of the specified portion of this SortedSet which
+	 * contains elements greater or equal to the start element. The returned
+	 * SortedSet is backed by this SortedSet so changes to one are reflected by
+	 * the other.
+	 * 
+	 * @param start
+	 *            the start element
+	 * @return a subset where the elements are greater or equal to
+	 *         <code>start</code>
+	 * 
+	 * @exception ClassCastException
+	 *                when the class of the start element is inappropriate for
+	 *                this SubSet
+	 * @exception NullPointerException
+	 *                when the start element is null and this SortedSet does not
+	 *                support null elements
+	 */
+	public SortedSet tailSet(Object start);
+}

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/util/Stack.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/util/Stack.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/util/Stack.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/util/Stack.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,109 @@
+/* Copyright 1998, 2004 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.util;
+
+
+/**
+ * <code>Stack</code> is a Last-In/First-Out(LIFO) data structure which
+ * represents a stack of objects. It enables users to pop and push onto the
+ * stack, including null objects. There is no limit to the size of the stack
+ */
+public class Stack extends Vector {
+	
+	static final long serialVersionUID = 1224463164541339165L;
+
+	/**
+	 * Constructs a stack with the default size of <code>Vector</code>.
+	 */
+	public Stack() {
+		super();
+	}
+
+	/**
+	 * Determines if the stack is empty or not.
+	 * 
+	 * @return true if the stack is empty, false otherwise
+	 */
+	public boolean empty() {
+		return elementCount == 0;
+	}
+
+	/**
+	 * Returns the element at the top of the stack without removing it.
+	 * 
+	 * @return the element at the top of the Stack
+	 * @exception EmptyStackException
+	 *                when empty() is true
+	 * @see #pop
+	 */
+	public synchronized Object peek() {
+		try {
+			return elementData[elementCount - 1];
+		} catch (IndexOutOfBoundsException e) {
+			throw new EmptyStackException();
+		}
+	}
+
+	/**
+	 * Returns the element at the top of the stack and removes it.
+	 * 
+	 * @return the element at the top of the stack.
+	 * @exception EmptyStackException
+	 *                when empty() is true
+	 * @see #peek
+	 * @see #push
+	 */
+	public synchronized Object pop() {
+		try {
+			int index = elementCount - 1;
+			Object obj = elementData[index];
+			removeElementAt(index);
+			return obj;
+		} catch (IndexOutOfBoundsException e) {
+			throw new EmptyStackException();
+		}
+	}
+
+	/**
+	 * Pushes the object from the parameter onto the top of the stack.
+	 * 
+	 * @param object
+	 *            The object to be added to the stack
+	 * 
+	 * @return the object argument
+	 * 
+	 * @see #peek
+	 * @see #pop
+	 */
+	public synchronized Object push(Object object) {
+		addElement(object);
+		return object;
+	}
+
+	/**
+	 * Returns the index of the first occurence of the object.
+	 * 
+	 * @return the index of the first occurence of the object
+	 * @param o
+	 *            the object to be searched
+	 */
+	public synchronized int search(Object o) {
+		int index = lastIndexOf(o);
+		if (index >= 0)
+			return (elementCount - index);
+		return -1;
+	}
+}

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/util/StringTokenizer.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/util/StringTokenizer.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/util/StringTokenizer.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/util/StringTokenizer.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,199 @@
+/* Copyright 1998, 2002 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.util;
+
+
+/**
+ * String tokenizer is used to break a string apart into tokens.
+ * 
+ * If returnDelimiters is false, successive calls to nextToken() return maximal
+ * blocks of characters that do not contain a delimiter.
+ * 
+ * If returnDelimiters is true, delimiters are considered to be tokens, and
+ * successive calls to nextToken() return either a one character delimiter, or a
+ * maximal block of text between delimiters.
+ */
+public class StringTokenizer implements Enumeration {
+	
+	private String string;
+
+	private String delimiters;
+
+	private boolean returnDelimiters;
+
+	private int position;
+
+	/**
+	 * Constructs a new StringTokenizer for string using whitespace as the
+	 * delimiter, returnDelimiters is false.
+	 * 
+	 * @param string
+	 *            the string to be tokenized
+	 */
+	public StringTokenizer(String string) {
+		this(string, " \t\n\r\f", false); //$NON-NLS-1$
+	}
+
+	/**
+	 * Constructs a new StringTokenizer for string using the specified
+	 * delimiters, returnDelimiters is false.
+	 * 
+	 * @param string
+	 *            the string to be tokenized
+	 * @param delimiters
+	 *            the delimiters to use
+	 */
+	public StringTokenizer(String string, String delimiters) {
+		this(string, delimiters, false);
+	}
+
+	/**
+	 * Constructs a new StringTokenizer for string using the specified
+	 * delimiters and returning delimiters as tokens when specified.
+	 * 
+	 * @param string
+	 *            the string to be tokenized
+	 * @param delimiters
+	 *            the delimiters to use
+	 * @param returnDelimiters
+	 *            true to return each delimiter as a token
+	 */
+	public StringTokenizer(String string, String delimiters,
+			boolean returnDelimiters) {
+		if (string != null) {
+			this.string = string;
+			this.delimiters = delimiters;
+			this.returnDelimiters = returnDelimiters;
+			this.position = 0;
+		} else
+			throw new NullPointerException();
+	}
+
+	/**
+	 * Returns the number of unprocessed tokens remaining in the string.
+	 * 
+	 * @return number of tokens that can be retreived before an exception will
+	 *         result
+	 */
+	public int countTokens() {
+		int count = 0;
+		boolean inToken = false;
+		for (int i = position, length = string.length(); i < length; i++) {
+			if (delimiters.indexOf(string.charAt(i), 0) >= 0) {
+				if (returnDelimiters)
+					count++;
+				if (inToken) {
+					count++;
+					inToken = false;
+				}
+			} else {
+				inToken = true;
+			}
+		}
+		if (inToken)
+			count++;
+		return count;
+	}
+
+	/**
+	 * Returns true if unprocessed tokens remain.
+	 * 
+	 * @return true if unprocessed tokens remain
+	 */
+	public boolean hasMoreElements() {
+		return hasMoreTokens();
+	}
+
+	/**
+	 * Returns true if unprocessed tokens remain.
+	 * 
+	 * @return true if unprocessed tokens remain
+	 */
+	public boolean hasMoreTokens() {
+		int length = string.length();
+		if (position < length) {
+			if (returnDelimiters)
+				return true; // there is at least one character and even if
+			// it is a delimiter it is a token
+
+			// otherwise find a character which is not a delimiter
+			for (int i = position; i < length; i++)
+				if (delimiters.indexOf(string.charAt(i), 0) == -1)
+					return true;
+		}
+		return false;
+	}
+
+	/**
+	 * Returns the next token in the string as an Object.
+	 * 
+	 * @return next token in the string as an Object
+	 * @exception NoSuchElementException
+	 *                if no tokens remain
+	 */
+	public Object nextElement() {
+		return nextToken();
+	}
+
+	/**
+	 * Returns the next token in the string as a String.
+	 * 
+	 * @return next token in the string as a String
+	 * @exception NoSuchElementException
+	 *                if no tokens remain
+	 */
+	public String nextToken() {
+		int i = position;
+		int length = string.length();
+
+		if (i < length) {
+			if (returnDelimiters) {
+				if (delimiters.indexOf(string.charAt(position), 0) >= 0)
+					return String.valueOf(string.charAt(position++));
+				for (position++; position < length; position++)
+					if (delimiters.indexOf(string.charAt(position), 0) >= 0)
+						return string.substring(i, position);
+				return string.substring(i);
+			}
+
+			while (i < length && delimiters.indexOf(string.charAt(i), 0) >= 0)
+				i++;
+			position = i;
+			if (i < length) {
+				for (position++; position < length; position++)
+					if (delimiters.indexOf(string.charAt(position), 0) >= 0)
+						return string.substring(i, position);
+				return string.substring(i);
+			}
+		}
+		throw new NoSuchElementException();
+	}
+
+	/**
+	 * Returns the next token in the string as a String. The delimiters used are
+	 * changed to the specified delimiters.
+	 * 
+	 * @param delims
+	 *            the new delimiters to use
+	 * @return next token in the string as a String
+	 * @exception NoSuchElementException
+	 *                if no tokens remain
+	 */
+	public String nextToken(String delims) {
+		this.delimiters = delims;
+		return nextToken();
+	}
+}

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/util/TimeZone.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/util/TimeZone.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/util/TimeZone.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/util/TimeZone.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,512 @@
+/* Copyright 1998, 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.util;
+
+
+import java.io.Serializable;
+import java.security.AccessController;
+import java.text.DateFormatSymbols;
+
+import com.ibm.oti.util.PriviAction;
+
+/**
+ * TimeZone is an abstract class which represents a local time zone and its
+ * daylight savings time rules. Subclasses support a particular calendar type,
+ * such as the gregorian calendar.
+ * 
+ * @see GregorianCalendar
+ * @see SimpleTimeZone
+ */
+
+abstract public class TimeZone implements Serializable, Cloneable {
+	static final long serialVersionUID = 3581463369166924961L;
+
+	/**
+	 * The SHORT display name style.
+	 */
+	public static final int SHORT = 0;
+
+	/**
+	 * The LONG display name style.
+	 */
+	public static final int LONG = 1;
+
+	private static HashMap AvailableZones;
+
+	private static TimeZone Default;
+
+	static TimeZone GMT = new SimpleTimeZone(0, "GMT"); // Greenwich Mean Time
+
+	private String ID;
+
+	private static void initializeAvailable() {
+		TimeZone[] zones = TimeZones.getTimeZones();
+		AvailableZones = new HashMap((zones.length + 1) * 4 / 3);
+		AvailableZones.put(GMT.getID(), GMT);
+		for (int i = 0; i < zones.length; i++)
+			AvailableZones.put(zones[i].getID(), zones[i]);
+	}
+
+	/**
+	 * Constructs a new instance of this class.
+	 * 
+	 */
+	public TimeZone() {
+	}
+
+	private void appendNumber(StringBuffer buffer, int count, int value) {
+		String string = Integer.toString(value);
+		if (count > string.length())
+			for (int i = 0; i < count - string.length(); i++)
+				buffer.append('0');
+		buffer.append(string);
+	}
+
+	/**
+	 * Answers a new TimeZone with the same ID, rawOffset and daylight savings
+	 * time rules as this TimeZone.
+	 * 
+	 * @return a shallow copy of this TimeZone
+	 * 
+	 * @see java.lang.Cloneable
+	 */
+	public Object clone() {
+		try {
+			TimeZone zone = (TimeZone) super.clone();
+			return zone;
+		} catch (CloneNotSupportedException e) {
+			return null;
+		}
+	}
+
+	/**
+	 * Gets the available time zone IDs.
+	 * 
+	 * @return an array of time zone ID strings
+	 */
+	public static synchronized String[] getAvailableIDs() {
+		if (AvailableZones == null)
+			initializeAvailable();
+		int length = AvailableZones.size();
+		String[] answer = new String[length];
+		Iterator keys = AvailableZones.keySet().iterator();
+		for (int i = 0; i < length; i++)
+			answer[i] = (String) keys.next();
+		return answer;
+	}
+
+	/**
+	 * Gets the available time zone IDs which match the specified offset from
+	 * GMT.
+	 * 
+	 * @param offset
+	 *            the offset from GMT in milliseconds
+	 * @return an array of time zone ID strings
+	 */
+	public static synchronized String[] getAvailableIDs(int offset) {
+		if (AvailableZones == null)
+			initializeAvailable();
+		int count = 0, length = AvailableZones.size();
+		String[] all = new String[length];
+		Iterator zones = AvailableZones.values().iterator();
+		for (int i = 0; i < length; i++) {
+			TimeZone tz = (TimeZone) zones.next();
+			if (tz.getRawOffset() == offset)
+				all[count++] = tz.getID();
+		}
+		String[] answer = new String[count];
+		System.arraycopy(all, 0, answer, 0, count);
+		return answer;
+	}
+
+	/**
+	 * Gets the default time zone.
+	 * 
+	 * @return the default time zone
+	 */
+	public static synchronized TimeZone getDefault() {
+		if (Default == null)
+			setDefault(null);
+		return (TimeZone) Default.clone();
+	}
+
+	/**
+	 * Gets the LONG name for this TimeZone for the default Locale in standard
+	 * time. If the name is not available, the result is in the format
+	 * GMT[+-]hh:mm.
+	 * 
+	 * @return the TimeZone name
+	 */
+	public final String getDisplayName() {
+		return getDisplayName(false, LONG, Locale.getDefault());
+	}
+
+	/**
+	 * Gets the LONG name for this TimeZone for the specified Locale in standard
+	 * time. If the name is not available, the result is in the format
+	 * GMT[+-]hh:mm.
+	 * 
+	 * @param locale
+	 *            the Locale
+	 * @return the TimeZone name
+	 */
+	public final String getDisplayName(Locale locale) {
+		return getDisplayName(false, LONG, locale);
+	}
+
+	/**
+	 * Gets the specified style of name (LONG or SHORT) for this TimeZone for
+	 * the default Locale in either standard or daylight time as specifed. If
+	 * the name is not available, the result is in the format GMT[+-]hh:mm.
+	 * 
+	 * @param daylightTime
+	 *            true for daylight time, false for standard time
+	 * @param style
+	 *            Either LONG or SHORT
+	 * @return the TimeZone name
+	 */
+	public final String getDisplayName(boolean daylightTime, int style) {
+		return getDisplayName(daylightTime, style, Locale.getDefault());
+	}
+
+	/**
+	 * Gets the specified style of name (LONG or SHORT) for this TimeZone for
+	 * the specified Locale in either standard or daylight time as specifed. If
+	 * the name is not available, the result is in the format GMT[+-]hh:mm.
+	 * 
+	 * @param daylightTime
+	 *            true for daylight time, false for standard time
+	 * @param style
+	 *            Either LONG or SHORT
+	 * @param locale
+	 *            the Locale
+	 * @return the TimeZone name
+	 */
+	public String getDisplayName(boolean daylightTime, int style, Locale locale) {
+		if (style == SHORT || style == LONG) {
+			boolean useDaylight = daylightTime && useDaylightTime();
+			DateFormatSymbols data = new DateFormatSymbols(locale);
+			String id = getID();
+			String[][] zones = data.getZoneStrings();
+			for (int i = 0; i < zones.length; i++)
+				if (id.equals(zones[i][0]))
+					return style == SHORT ? zones[i][useDaylight ? 4 : 2]
+							: zones[i][useDaylight ? 3 : 1];
+			int offset = getRawOffset();
+			if (useDaylight && this instanceof SimpleTimeZone)
+				offset += ((SimpleTimeZone) this).getDSTSavings();
+			offset /= 60000;
+			char sign = '+';
+			if (offset < 0) {
+				sign = '-';
+				offset = -offset;
+			}
+			StringBuffer buffer = new StringBuffer(9);
+			buffer.append("GMT");
+			buffer.append(sign);
+			appendNumber(buffer, 2, offset / 60);
+			buffer.append(':');
+			appendNumber(buffer, 2, offset % 60);
+			return buffer.toString();
+		}
+		throw new IllegalArgumentException();
+	}
+
+	/**
+	 * Gets the ID of this TimeZone.
+	 * 
+	 * @return the time zone ID string
+	 */
+	public String getID() {
+		return ID;
+	}
+
+	/**
+	 * Gets the daylight savings offset in milliseconds for this TimeZone.
+	 * <p>
+	 * This implementation returns 3600000 (1 hour), or 0 if the time zone does
+	 * not observe daylight savings.
+	 * <p>
+	 * Subclasses may override to return daylight savings values other than 1
+	 * hour.
+	 * <p>
+	 * 
+	 * @return the daylight savings offset in milliseconds if this Timezone
+	 *         observes daylight savings, zero otherwise.
+	 * 
+	 */
+	public int getDSTSavings() {
+		if (useDaylightTime()) {
+			return 3600000;
+		}
+		return 0;
+	}
+
+	/**
+	 * Gets the offset from GMT of this TimeZone for the specified date. The
+	 * offset includes daylight savings time if the specified date is within the
+	 * daylight savings time period.
+	 * 
+	 * @param time
+	 *            the date in milliseconds since January 1, 1970 00:00:00 GMT
+	 * @return the offset from GMT in milliseconds
+	 */
+	public int getOffset(long time) {
+		if (inDaylightTime(new Date(time))) {
+			return getRawOffset() + getDSTSavings();
+		}
+		return getRawOffset();
+	}
+
+	/**
+	 * Gets the offset from GMT of this TimeZone for the specified date and
+	 * time. The offset includes daylight savings time if the specified date and
+	 * time are within the daylight savings time period.
+	 * 
+	 * @param era
+	 *            the GregorianCalendar era, either GregorianCalendar.BC or
+	 *            GregorianCalendar.AD
+	 * @param year
+	 *            the year
+	 * @param month
+	 *            the Calendar month
+	 * @param day
+	 *            the day of the month
+	 * @param dayOfWeek
+	 *            the Calendar day of the week
+	 * @param time
+	 *            the time of day in milliseconds
+	 * @return the offset from GMT in milliseconds
+	 */
+	abstract public int getOffset(int era, int year, int month, int day,
+			int dayOfWeek, int time);
+
+	/**
+	 * Gets the offset for standard time from GMT for this TimeZone.
+	 * 
+	 * @return the offset from GMT in milliseconds
+	 */
+	abstract public int getRawOffset();
+
+	/**
+	 * Gets the time zone with the specified ID.
+	 * 
+	 * @param name
+	 *            a time zone string ID
+	 * @return the time zone with the specified ID or null if a time zone with
+	 *         the specified ID does not exist
+	 */
+	public static synchronized TimeZone getTimeZone(String name) {
+		if (AvailableZones == null)
+			initializeAvailable();
+		TimeZone zone = (TimeZone) AvailableZones.get(name);
+		if (zone == null) {
+			if (name.startsWith("GMT") && name.length() > 3) {
+				char sign = name.charAt(3);
+				if (sign == '+' || sign == '-') {
+					int[] position = new int[1];
+					String formattedName = formatTimeZoneName(name, 4);
+					int hour = parseNumber(formattedName, 4, position);
+					if (hour < 0 || hour > 23) {
+						return (TimeZone) GMT.clone();
+					}
+					int index = position[0];
+					if (index != -1) {
+						int raw = hour * 3600000;
+						if (index < formattedName.length()
+								&& formattedName.charAt(index) == ':') {
+							int minute = parseNumber(formattedName, index + 1,
+									position);
+							if (position[0] == -1 || minute < 0 || minute > 59)
+								return (TimeZone) GMT.clone();
+							raw += minute * 60000;
+						} else if (hour >= 30 || index > 6) {
+							raw = (hour / 100 * 3600000) + (hour % 100 * 60000);
+						}
+						if (sign == '-')
+							raw = -raw;
+						return new SimpleTimeZone(raw, formattedName);
+					}
+				}
+			}
+			zone = GMT;
+		}
+		return (TimeZone) zone.clone();
+	}
+
+	private static String formatTimeZoneName(String name, int offset) {
+		StringBuffer buf = new StringBuffer();
+		int index = offset, length = name.length();
+		buf.append(name.substring(0, offset));
+
+		while (index < length) {
+			if (Character.digit(name.charAt(index), 10) != -1) {
+				buf.append(name.charAt(index));
+				if ((length - (index + 1)) == 2) {
+					buf.append(':');
+				}
+			} else if (name.charAt(index) == ':') {
+				buf.append(':');
+			}
+			index++;
+		}
+
+		if (buf.toString().indexOf(":") == -1) {
+			buf.append(':');
+			buf.append("00");
+		}
+
+		if (buf.toString().indexOf(":") == 5) {
+			buf.insert(4, '0');
+		}
+
+		return buf.toString();
+	}
+
+	/**
+	 * Answers if the specified TimeZone has the same raw offset as this
+	 * TimeZone.
+	 * 
+	 * @param zone
+	 *            a TimeZone
+	 * @return true when the TimeZones have the same raw offset, false otherwise
+	 */
+	public boolean hasSameRules(TimeZone zone) {
+		if (zone == null)
+			return false;
+		return getRawOffset() == zone.getRawOffset();
+	}
+
+	/**
+	 * Answers if the specified Date is in the daylight savings time period for
+	 * this TimeZone.
+	 * 
+	 * @param time
+	 *            a Date
+	 * @return true when the Date is in the daylight savings time period, false
+	 *         otherwise
+	 */
+	abstract public boolean inDaylightTime(Date time);
+
+	private static int parseNumber(String string, int offset, int[] position) {
+		int index = offset, length = string.length(), digit, result = 0;
+		while (index < length
+				&& (digit = Character.digit(string.charAt(index), 10)) != -1) {
+			index++;
+			result = result * 10 + digit;
+		}
+		position[0] = index == offset ? -1 : index;
+		return result;
+	}
+
+	/**
+	 * Sets the default time zone.
+	 * 
+	 * @param timezone
+	 *            a TimeZone object
+	 */
+	public static synchronized void setDefault(TimeZone timezone) {
+		if (timezone != null) {
+			Default = timezone;
+			return;
+		}
+
+		String zone = (String) AccessController.doPrivileged(new PriviAction(
+				"user.timezone"));
+
+		// if property user.timezone is not set, we call the native method
+		// getCustomTimeZone
+		if (zone == null) {
+			int[] tzinfo = new int[10];
+			boolean[] isCustomTimeZone = new boolean[1];
+
+			String zoneId = getCustomTimeZone(tzinfo, isCustomTimeZone);
+
+			// if returned TimeZone is a user customized TimeZone
+			if (isCustomTimeZone[0]) {
+				// build a new SimpleTimeZone
+				switch (tzinfo[1]) {
+				case 0:
+					// does not observe DST
+					Default = new SimpleTimeZone(tzinfo[0], zoneId);
+					break;
+				default:
+					// observes DST
+					Default = new SimpleTimeZone(tzinfo[0], zoneId, tzinfo[5],
+							tzinfo[4], tzinfo[3], tzinfo[2], tzinfo[9],
+							tzinfo[8], tzinfo[7], tzinfo[6], tzinfo[1]);
+				}
+			} else {
+				// get TimeZone
+				Default = getTimeZone(zoneId);
+			}
+		} else {
+			// if property user.timezone is set in command line (with -D option)
+			Default = getTimeZone(zone);
+		}
+	}
+
+	/**
+	 * Sets the ID of this TimeZone.
+	 * 
+	 * @param name
+	 *            a string which is the time zone ID
+	 */
+	public void setID(String name) {
+		if (name == null)
+			throw new NullPointerException();
+		ID = name;
+	}
+
+	/**
+	 * Sets the offset for standard time from GMT for this TimeZone.
+	 * 
+	 * @param offset
+	 *            the offset from GMT in milliseconds
+	 */
+	abstract public void setRawOffset(int offset);
+
+	/**
+	 * Answers if this TimeZone has a daylight savings time period.
+	 * 
+	 * @return true if this time zone has a daylight savings time period, false
+	 *         otherwise
+	 */
+	abstract public boolean useDaylightTime();
+
+	/**
+	 * Gets the name and the details of the user-selected TimeZone on the
+	 * device.
+	 * 
+	 * @param tzinfo
+	 *            int array of 10 elements to be filled with the TimeZone
+	 *            information. Once filled, the contents of the array are
+	 *            formatted as follows: tzinfo[0] -> the timezone offset;
+	 *            tzinfo[1] -> the dst adjustment; tzinfo[2] -> the dst start
+	 *            hour; tzinfo[3] -> the dst start day of week; tzinfo[4] -> the
+	 *            dst start week of month; tzinfo[5] -> the dst start month;
+	 *            tzinfo[6] -> the dst end hour; tzinfo[7] -> the dst end day of
+	 *            week; tzinfo[8] -> the dst end week of month; tzinfo[9] -> the
+	 *            dst end month;
+	 * @param isCustomTimeZone
+	 *            boolean array of size 1 that indicates if a timezone
+	 *            match is found
+	 * @return the name of the TimeZone or null if error occurs in native
+	 *         method.
+	 */
+	private static native String getCustomTimeZone(int[] tzinfo,
+			boolean[] isCustomTimeZone);
+}

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/util/TimeZones.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/util/TimeZones.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/util/TimeZones.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/util/TimeZones.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,596 @@
+/* Copyright 2001, 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.util;
+
+
+final class TimeZones {
+
+	private static final int ONE_HOUR = 3600000;
+
+	public static TimeZone[] getTimeZones() {
+		return new TimeZone[] {
+				new SimpleTimeZone(-11 * ONE_HOUR, "MIT"), //$NON-NLS-1$
+				new SimpleTimeZone(-10 * ONE_HOUR, "HST"), //$NON-NLS-1$
+				new SimpleTimeZone(-9 * ONE_HOUR, "AST", Calendar.APRIL, 1, //$NON-NLS-1$
+						-Calendar.SUNDAY, 2 * ONE_HOUR, Calendar.OCTOBER, -1,
+						Calendar.SUNDAY, 2 * ONE_HOUR),
+				new SimpleTimeZone(-8 * ONE_HOUR, "PST", Calendar.APRIL, 1, //$NON-NLS-1$
+						-Calendar.SUNDAY, 2 * ONE_HOUR, Calendar.OCTOBER, -1,
+						Calendar.SUNDAY, 2 * ONE_HOUR),
+				new SimpleTimeZone(-7 * ONE_HOUR, "MST", Calendar.APRIL, 1, //$NON-NLS-1$
+						-Calendar.SUNDAY, 2 * ONE_HOUR, Calendar.OCTOBER, -1,
+						Calendar.SUNDAY, 2 * ONE_HOUR),
+				new SimpleTimeZone(-7 * ONE_HOUR, "PNT"), //$NON-NLS-1$
+				new SimpleTimeZone(-6 * ONE_HOUR, "CST", Calendar.APRIL, 1, //$NON-NLS-1$
+						-Calendar.SUNDAY, 2 * ONE_HOUR, Calendar.OCTOBER, -1,
+						Calendar.SUNDAY, 2 * ONE_HOUR),
+				new SimpleTimeZone(-5 * ONE_HOUR, "EST", Calendar.APRIL, 1, //$NON-NLS-1$
+						-Calendar.SUNDAY, 2 * ONE_HOUR, Calendar.OCTOBER, -1,
+						Calendar.SUNDAY, 2 * ONE_HOUR),
+				new SimpleTimeZone(-5 * ONE_HOUR, "IET"), //$NON-NLS-1$
+				new SimpleTimeZone(-4 * ONE_HOUR, "PRT"), //$NON-NLS-1$
+				new SimpleTimeZone(-3 * ONE_HOUR - 1800000, "CNT", //$NON-NLS-1$
+						Calendar.APRIL, 1, -Calendar.SUNDAY, 60000,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 60000),
+				new SimpleTimeZone(-3 * ONE_HOUR, "AGT"), //$NON-NLS-1$
+				new SimpleTimeZone(-3 * ONE_HOUR, "BET", Calendar.OCTOBER, 8, //$NON-NLS-1$
+						-Calendar.SUNDAY, 0 * ONE_HOUR, Calendar.FEBRUARY, 15,
+						-Calendar.SUNDAY, 0 * ONE_HOUR),
+				new SimpleTimeZone(0 * ONE_HOUR, "UTC"), //$NON-NLS-1$
+				new SimpleTimeZone(0 * ONE_HOUR, "WET", Calendar.MARCH, -1, //$NON-NLS-1$
+						Calendar.SUNDAY, 1 * ONE_HOUR, Calendar.OCTOBER, -1,
+						Calendar.SUNDAY, 1 * ONE_HOUR),
+				new SimpleTimeZone(1 * ONE_HOUR, "ECT", Calendar.MARCH, -1, //$NON-NLS-1$
+						Calendar.SUNDAY, 1 * ONE_HOUR, Calendar.OCTOBER, -1,
+						Calendar.SUNDAY, 1 * ONE_HOUR),
+				new SimpleTimeZone(1 * ONE_HOUR, "MET", Calendar.MARCH, 21, 0, //$NON-NLS-1$
+						0 * ONE_HOUR, Calendar.SEPTEMBER, 23, 0, 0 * ONE_HOUR),
+				new SimpleTimeZone(2 * ONE_HOUR, "ART", Calendar.APRIL, -1, //$NON-NLS-1$
+						Calendar.FRIDAY, 0 * ONE_HOUR, Calendar.SEPTEMBER, -1,
+						Calendar.THURSDAY, 23 * ONE_HOUR),
+				new SimpleTimeZone(2 * ONE_HOUR, "CAT"), //$NON-NLS-1$
+				new SimpleTimeZone(2 * ONE_HOUR, "EET", Calendar.MARCH, -1, //$NON-NLS-1$
+						Calendar.SUNDAY, 1 * ONE_HOUR, Calendar.OCTOBER, -1,
+						Calendar.SUNDAY, 1 * ONE_HOUR),
+				new SimpleTimeZone(3 * ONE_HOUR, "EAT"), //$NON-NLS-1$
+				new SimpleTimeZone(3 * ONE_HOUR + 1800000, "Asia/Tehran", //$NON-NLS-1$
+						Calendar.MARCH, 21, 0, 0 * ONE_HOUR,
+						Calendar.SEPTEMBER, 23, 0, 0 * ONE_HOUR),
+				new SimpleTimeZone(4 * ONE_HOUR, "NET", Calendar.MARCH, -1, //$NON-NLS-1$
+						Calendar.SUNDAY, 2 * ONE_HOUR, Calendar.OCTOBER, -1,
+						Calendar.SUNDAY, 2 * ONE_HOUR),
+				new SimpleTimeZone(5 * ONE_HOUR, "PLT"), //$NON-NLS-1$
+				new SimpleTimeZone(5 * ONE_HOUR + 1800000, "IST"), //$NON-NLS-1$
+				new SimpleTimeZone(6 * ONE_HOUR, "BST"), //$NON-NLS-1$
+				new SimpleTimeZone(7 * ONE_HOUR, "VST"), //$NON-NLS-1$
+				new SimpleTimeZone(8 * ONE_HOUR, "CTT"), //$NON-NLS-1$
+				new SimpleTimeZone(9 * ONE_HOUR, "JST"), //$NON-NLS-1$
+				new SimpleTimeZone(9 * ONE_HOUR + 1800000, "ACT"), //$NON-NLS-1$
+				new SimpleTimeZone(10 * ONE_HOUR, "AET", Calendar.OCTOBER, -1, //$NON-NLS-1$
+						Calendar.SUNDAY, 2 * ONE_HOUR, Calendar.MARCH, -1,
+						Calendar.SUNDAY, 2 * ONE_HOUR),
+				new SimpleTimeZone(11 * ONE_HOUR, "SST"), //$NON-NLS-1$
+				new SimpleTimeZone(12 * ONE_HOUR, "NST", Calendar.OCTOBER, 1, //$NON-NLS-1$
+						-Calendar.SUNDAY, 2 * ONE_HOUR, Calendar.MARCH, 15,
+						-Calendar.SUNDAY, 2 * ONE_HOUR),
+
+				new SimpleTimeZone(-6 * ONE_HOUR, "America/Costa_Rica"), //$NON-NLS-1$
+				new SimpleTimeZone(-4 * ONE_HOUR, "America/Halifax", //$NON-NLS-1$
+						Calendar.APRIL, 1, -Calendar.SUNDAY, 2 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 2 * ONE_HOUR),
+				new SimpleTimeZone(-2 * ONE_HOUR, "Atlantic/South_Georgia"), //$NON-NLS-1$
+				new SimpleTimeZone(0 * ONE_HOUR, "Europe/London", //$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY, 1 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 1 * ONE_HOUR),
+				new SimpleTimeZone(1 * ONE_HOUR, "Africa/Algiers"), //$NON-NLS-1$
+				new SimpleTimeZone(2 * ONE_HOUR, "Africa/Cairo", //$NON-NLS-1$
+						Calendar.APRIL, -1, Calendar.FRIDAY, 0 * ONE_HOUR,
+						Calendar.SEPTEMBER, -1, Calendar.THURSDAY,
+						23 * ONE_HOUR),
+				new SimpleTimeZone(2 * ONE_HOUR, "Africa/Harare"), //$NON-NLS-1$
+				new SimpleTimeZone(2 * ONE_HOUR, "Asia/Jerusalem", //$NON-NLS-1$
+						Calendar.APRIL, 9, 0, 1 * ONE_HOUR, Calendar.SEPTEMBER,
+						24, 0, 1 * ONE_HOUR),
+				new SimpleTimeZone(2 * ONE_HOUR, "Europe/Bucharest", //$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY, 1 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 1 * ONE_HOUR),
+				new SimpleTimeZone(3 * ONE_HOUR, "Europe/Moscow", //$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY, 2 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 2 * ONE_HOUR),
+				new SimpleTimeZone(4 * ONE_HOUR + 1800000, "Asia/Kabul"), //$NON-NLS-1$
+				new SimpleTimeZone(9 * ONE_HOUR + 1800000,
+						"Australia/Adelaide", Calendar.OCTOBER, -1, //$NON-NLS-1$
+						Calendar.SUNDAY, 2 * ONE_HOUR, Calendar.MARCH, -1,
+						Calendar.SUNDAY, 2 * ONE_HOUR),
+				new SimpleTimeZone(10 * ONE_HOUR, "Australia/Brisbane"), //$NON-NLS-1$
+				new SimpleTimeZone(10 * ONE_HOUR, "Australia/Hobart", //$NON-NLS-1$
+						Calendar.OCTOBER, 1, -Calendar.SUNDAY, 2 * ONE_HOUR,
+						Calendar.MARCH, -1, Calendar.SUNDAY, 2 * ONE_HOUR),
+
+				new SimpleTimeZone(-9 * ONE_HOUR - 1800000, "Pacific/Marquesas"), //$NON-NLS-1$
+				new SimpleTimeZone(-1 * ONE_HOUR, "Atlantic/Azores", //$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY, 1 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 1 * ONE_HOUR),
+				new SimpleTimeZone(4 * ONE_HOUR, "Asia/Dubai"), //$NON-NLS-1$
+				new SimpleTimeZone(20700000, "Asia/Katmandu"), //$NON-NLS-1$
+				new SimpleTimeZone(6 * ONE_HOUR + 1800000, "Asia/Rangoon"), //$NON-NLS-1$
+				new SimpleTimeZone(45900000, "Pacific/Chatham", //$NON-NLS-1$
+						Calendar.OCTOBER, 1, -Calendar.SUNDAY, 9900000,
+						Calendar.MARCH, 15, -Calendar.SUNDAY, 9900000),
+
+				new SimpleTimeZone(-11 * ONE_HOUR, "Pacific/Apia"), //$NON-NLS-1$
+				new SimpleTimeZone(-11 * ONE_HOUR, "Pacific/Niue"), //$NON-NLS-1$
+				new SimpleTimeZone(-11 * ONE_HOUR, "Pacific/Pago_Pago"), //$NON-NLS-1$
+				new SimpleTimeZone(-10 * ONE_HOUR, "America/Adak", //$NON-NLS-1$
+						Calendar.APRIL, 1, -Calendar.SUNDAY, 2 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 2 * ONE_HOUR),
+				new SimpleTimeZone(-10 * ONE_HOUR, "Pacific/Fakaofo"), //$NON-NLS-1$
+				new SimpleTimeZone(-10 * ONE_HOUR, "Pacific/Honolulu"), //$NON-NLS-1$
+				new SimpleTimeZone(-10 * ONE_HOUR, "Pacific/Rarotonga"), //$NON-NLS-1$
+				new SimpleTimeZone(-10 * ONE_HOUR, "Pacific/Tahiti"), //$NON-NLS-1$
+				new SimpleTimeZone(-9 * ONE_HOUR, "America/Anchorage", //$NON-NLS-1$
+						Calendar.APRIL, 1, -Calendar.SUNDAY, 2 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 2 * ONE_HOUR),
+				new SimpleTimeZone(-9 * ONE_HOUR, "Pacific/Gambier"), //$NON-NLS-1$
+				new SimpleTimeZone(-8 * ONE_HOUR, "America/Los_Angeles", //$NON-NLS-1$
+						Calendar.APRIL, 1, -Calendar.SUNDAY, 2 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 2 * ONE_HOUR),
+				new SimpleTimeZone(-8 * ONE_HOUR, "America/Tijuana", //$NON-NLS-1$
+						Calendar.APRIL, 1, -Calendar.SUNDAY, 2 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 2 * ONE_HOUR),
+				new SimpleTimeZone(-8 * ONE_HOUR, "America/Vancouver", //$NON-NLS-1$
+						Calendar.APRIL, 1, -Calendar.SUNDAY, 2 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 2 * ONE_HOUR),
+				new SimpleTimeZone(-8 * ONE_HOUR, "Pacific/Pitcairn"), //$NON-NLS-1$
+				new SimpleTimeZone(-7 * ONE_HOUR, "America/Dawson_Creek"), //$NON-NLS-1$
+				new SimpleTimeZone(-7 * ONE_HOUR, "America/Denver", //$NON-NLS-1$
+						Calendar.APRIL, 1, -Calendar.SUNDAY, 2 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 2 * ONE_HOUR),
+				new SimpleTimeZone(-7 * ONE_HOUR, "America/Edmonton", //$NON-NLS-1$
+						Calendar.APRIL, 1, -Calendar.SUNDAY, 2 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 2 * ONE_HOUR),
+				new SimpleTimeZone(-7 * ONE_HOUR, "America/Mazatlan", //$NON-NLS-1$
+						Calendar.MAY, 1, -Calendar.SUNDAY, 2 * ONE_HOUR,
+						Calendar.SEPTEMBER, -1, Calendar.SUNDAY, 2 * ONE_HOUR),
+				new SimpleTimeZone(-7 * ONE_HOUR, "America/Phoenix"), //$NON-NLS-1$
+				new SimpleTimeZone(-6 * ONE_HOUR, "America/Belize"), //$NON-NLS-1$
+				new SimpleTimeZone(-6 * ONE_HOUR, "America/Chicago", //$NON-NLS-1$
+						Calendar.APRIL, 1, -Calendar.SUNDAY, 2 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 2 * ONE_HOUR),
+				new SimpleTimeZone(-6 * ONE_HOUR, "America/El_Salvador"), //$NON-NLS-1$
+				new SimpleTimeZone(-6 * ONE_HOUR, "America/Managua"), //$NON-NLS-1$
+				new SimpleTimeZone(-6 * ONE_HOUR, "America/Mexico_City", //$NON-NLS-1$
+						Calendar.MAY, 1, -Calendar.SUNDAY, 2 * ONE_HOUR,
+						Calendar.SEPTEMBER, -1, Calendar.SUNDAY, 2 * ONE_HOUR),
+				new SimpleTimeZone(-6 * ONE_HOUR, "America/Regina"), //$NON-NLS-1$
+				new SimpleTimeZone(-6 * ONE_HOUR, "America/Tegucigalpa"), //$NON-NLS-1$
+				new SimpleTimeZone(-6 * ONE_HOUR, "America/Winnipeg", //$NON-NLS-1$ //$NON-NLS-1$
+						Calendar.APRIL, 1, -Calendar.SUNDAY, 2 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 2 * ONE_HOUR),
+				new SimpleTimeZone(-6 * ONE_HOUR, "Pacific/Easter", //$NON-NLS-1$
+						Calendar.OCTOBER, 9, -Calendar.SUNDAY, 4 * ONE_HOUR,
+						Calendar.MARCH, 9, -Calendar.SUNDAY, 3 * ONE_HOUR),
+				new SimpleTimeZone(-6 * ONE_HOUR, "Pacific/Galapagos"), //$NON-NLS-1$
+				new SimpleTimeZone(-5 * ONE_HOUR, "America/Bogota"), //$NON-NLS-1$
+				new SimpleTimeZone(-5 * ONE_HOUR, "America/Cayman"), //$NON-NLS-1$
+				new SimpleTimeZone(-5 * ONE_HOUR, "America/Grand_Turk",//$NON-NLS-1$
+						Calendar.APRIL, 1, -Calendar.SUNDAY, 0 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 0 * ONE_HOUR),
+				new SimpleTimeZone(-5 * ONE_HOUR, "America/Guayaquil"), //$NON-NLS-1$
+				new SimpleTimeZone(-5 * ONE_HOUR, "America/Havana", //$NON-NLS-1$
+						Calendar.APRIL, 1, -Calendar.SUNDAY, 0 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 0 * ONE_HOUR),
+				new SimpleTimeZone(-5 * ONE_HOUR, "America/Indianapolis"), //$NON-NLS-1$
+				new SimpleTimeZone(-5 * ONE_HOUR, "America/Jamaica"), //$NON-NLS-1$
+				new SimpleTimeZone(-5 * ONE_HOUR, "America/Lima"), //$NON-NLS-1$
+				new SimpleTimeZone(-5 * ONE_HOUR, "America/Montreal", //$NON-NLS-1$
+						Calendar.APRIL, 1, -Calendar.SUNDAY, 2 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 2 * ONE_HOUR),
+				new SimpleTimeZone(-5 * ONE_HOUR, "America/Nassau", //$NON-NLS-1$
+						Calendar.APRIL, 1, -Calendar.SUNDAY, 2 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 2 * ONE_HOUR),
+				new SimpleTimeZone(-5 * ONE_HOUR, "America/New_York", //$NON-NLS-1$
+						Calendar.APRIL, 1, -Calendar.SUNDAY, 2 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 2 * ONE_HOUR),
+				new SimpleTimeZone(-5 * ONE_HOUR, "America/Panama"), //$NON-NLS-1$
+				new SimpleTimeZone(-5 * ONE_HOUR, "America/Port-au-Prince"), //$NON-NLS-1$
+				new SimpleTimeZone(-5 * ONE_HOUR, "America/Porto_Acre"), //$NON-NLS-1$
+				new SimpleTimeZone(-5 * ONE_HOUR, "America/Rio_Branco"), //$NON-NLS-1$
+				new SimpleTimeZone(-4 * ONE_HOUR, "America/Anguilla"), //$NON-NLS-1$
+				new SimpleTimeZone(-4 * ONE_HOUR, "America/Antigua"), //$NON-NLS-1$
+				new SimpleTimeZone(-4 * ONE_HOUR, "America/Aruba"), //$NON-NLS-1$
+				new SimpleTimeZone(-4 * ONE_HOUR, "America/Asuncion", //$NON-NLS-1$
+						Calendar.OCTOBER, 1, -Calendar.SUNDAY, 0 * ONE_HOUR,
+						Calendar.MARCH, 1, -Calendar.SUNDAY, 0 * ONE_HOUR),
+				new SimpleTimeZone(-4 * ONE_HOUR, "America/Barbados"),//$NON-NLS-1$
+				new SimpleTimeZone(-4 * ONE_HOUR, "America/Caracas"),//$NON-NLS-1$
+				new SimpleTimeZone(-4 * ONE_HOUR, "America/Cuiaba",//$NON-NLS-1$
+						Calendar.OCTOBER, 8, -Calendar.SUNDAY, 0 * ONE_HOUR,
+						Calendar.FEBRUARY, 15, -Calendar.SUNDAY, 0 * ONE_HOUR),
+				new SimpleTimeZone(-4 * ONE_HOUR, "America/Curacao"),//$NON-NLS-1$
+				new SimpleTimeZone(-4 * ONE_HOUR, "America/Dominica"),//$NON-NLS-1$
+				new SimpleTimeZone(-4 * ONE_HOUR, "America/Grenada"),//$NON-NLS-1$
+				new SimpleTimeZone(-4 * ONE_HOUR, "America/Guadeloupe"),//$NON-NLS-1$
+				new SimpleTimeZone(-4 * ONE_HOUR, "America/Guyana"),//$NON-NLS-1$
+				new SimpleTimeZone(-4 * ONE_HOUR, "America/La_Paz"),//$NON-NLS-1$
+				new SimpleTimeZone(-4 * ONE_HOUR, "America/Manaus"),//$NON-NLS-1$
+				new SimpleTimeZone(-4 * ONE_HOUR, "America/Martinique"),//$NON-NLS-1$
+				new SimpleTimeZone(-4 * ONE_HOUR, "America/Montserrat"),//$NON-NLS-1$
+				new SimpleTimeZone(-4 * ONE_HOUR, "America/Port_of_Spain"),//$NON-NLS-1$
+				new SimpleTimeZone(-4 * ONE_HOUR, "America/Puerto_Rico"),//$NON-NLS-1$
+				new SimpleTimeZone(-4 * ONE_HOUR, "America/Santiago",//$NON-NLS-1$
+						Calendar.OCTOBER, 9, -Calendar.SUNDAY, 4 * ONE_HOUR,
+						Calendar.MARCH, 9, -Calendar.SUNDAY, 3 * ONE_HOUR),
+				new SimpleTimeZone(-4 * ONE_HOUR, "America/Santo_Domingo"),//$NON-NLS-1$
+				new SimpleTimeZone(-4 * ONE_HOUR, "America/St_Kitts"),//$NON-NLS-1$
+				new SimpleTimeZone(-4 * ONE_HOUR, "America/St_Lucia"),//$NON-NLS-1$
+				new SimpleTimeZone(-4 * ONE_HOUR, "America/St_Thomas"),//$NON-NLS-1$
+				new SimpleTimeZone(-4 * ONE_HOUR, "America/St_Vincent"),//$NON-NLS-1$
+				new SimpleTimeZone(-4 * ONE_HOUR, "America/Thule",//$NON-NLS-1$
+						Calendar.APRIL, 1, -Calendar.SUNDAY, 2 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 2 * ONE_HOUR),
+				new SimpleTimeZone(-4 * ONE_HOUR, "America/Tortola"),//$NON-NLS-1$
+				new SimpleTimeZone(-4 * ONE_HOUR, "Antarctica/Palmer",//$NON-NLS-1$
+						Calendar.OCTOBER, 9, -Calendar.SUNDAY, 0 * ONE_HOUR,
+						Calendar.MARCH, 9, -Calendar.SUNDAY, 0 * ONE_HOUR),
+				new SimpleTimeZone(-4 * ONE_HOUR, "Atlantic/Bermuda",//$NON-NLS-1$
+						Calendar.APRIL, 1, -Calendar.SUNDAY, 2 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 2 * ONE_HOUR),
+				new SimpleTimeZone(-4 * ONE_HOUR, "Atlantic/Stanley",//$NON-NLS-1$
+						Calendar.SEPTEMBER, 1, -Calendar.SUNDAY, 2 * ONE_HOUR,
+						Calendar.APRIL, 15, -Calendar.SUNDAY, 2 * ONE_HOUR),
+				new SimpleTimeZone(-3 * ONE_HOUR - 1800000, "America/St_Johns",//$NON-NLS-1$
+						Calendar.APRIL, 1, -Calendar.SUNDAY, 60000,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 60000),
+				new SimpleTimeZone(-3 * ONE_HOUR, "America/Buenos_Aires"),//$NON-NLS-1$
+				new SimpleTimeZone(-3 * ONE_HOUR, "America/Cayenne"),//$NON-NLS-1$
+				new SimpleTimeZone(-3 * ONE_HOUR, "America/Fortaleza"),//$NON-NLS-1$
+				new SimpleTimeZone(-3 * ONE_HOUR, "America/Godthab",//$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY, 1 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 1 * ONE_HOUR),
+				new SimpleTimeZone(-3 * ONE_HOUR, "America/Miquelon",//$NON-NLS-1$
+						Calendar.APRIL, 1, -Calendar.SUNDAY, 2 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 2 * ONE_HOUR),
+				new SimpleTimeZone(-3 * ONE_HOUR, "America/Montevideo"),//$NON-NLS-1$
+				new SimpleTimeZone(-3 * ONE_HOUR, "America/Paramaribo"),//$NON-NLS-1$
+				new SimpleTimeZone(-3 * ONE_HOUR, "America/Sao_Paulo",//$NON-NLS-1$
+						Calendar.OCTOBER, 8, -Calendar.SUNDAY, 0 * ONE_HOUR,
+						Calendar.FEBRUARY, 15, -Calendar.SUNDAY, 0 * ONE_HOUR),
+				new SimpleTimeZone(-2 * ONE_HOUR, "America/Noronha"),//$NON-NLS-1$
+				new SimpleTimeZone(-1 * ONE_HOUR, "America/Scoresbysund",//$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY, 1 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 1 * ONE_HOUR),
+				new SimpleTimeZone(-1 * ONE_HOUR, "Atlantic/Cape_Verde"),//$NON-NLS-1$
+				new SimpleTimeZone(0 * ONE_HOUR, "Africa/Abidjan"),//$NON-NLS-1$
+				new SimpleTimeZone(0 * ONE_HOUR, "Africa/Accra"),//$NON-NLS-1$
+				new SimpleTimeZone(0 * ONE_HOUR, "Africa/Banjul"),//$NON-NLS-1$
+				new SimpleTimeZone(0 * ONE_HOUR, "Africa/Bissau"),//$NON-NLS-1$
+				new SimpleTimeZone(0 * ONE_HOUR, "Africa/Casablanca"),//$NON-NLS-1$
+				new SimpleTimeZone(0 * ONE_HOUR, "Africa/Conakry"),//$NON-NLS-1$
+				new SimpleTimeZone(0 * ONE_HOUR, "Africa/Dakar"),//$NON-NLS-1$
+				new SimpleTimeZone(0 * ONE_HOUR, "Africa/Freetown"),//$NON-NLS-1$
+				new SimpleTimeZone(0 * ONE_HOUR, "Africa/Lome"),//$NON-NLS-1$
+				new SimpleTimeZone(0 * ONE_HOUR, "Africa/Monrovia"),//$NON-NLS-1$
+				new SimpleTimeZone(0 * ONE_HOUR, "Africa/Nouakchott"),//$NON-NLS-1$
+				new SimpleTimeZone(0 * ONE_HOUR, "Africa/Ouagadougou"),//$NON-NLS-1$
+				new SimpleTimeZone(0 * ONE_HOUR, "Africa/Sao_Tome"),//$NON-NLS-1$
+				new SimpleTimeZone(0 * ONE_HOUR, "Africa/Timbuktu"),//$NON-NLS-1$
+				new SimpleTimeZone(0 * ONE_HOUR, "Atlantic/Canary",//$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY, 1 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 1 * ONE_HOUR),
+				new SimpleTimeZone(0 * ONE_HOUR, "Atlantic/Faeroe",//$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY, 1 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 1 * ONE_HOUR),
+				new SimpleTimeZone(0 * ONE_HOUR, "Atlantic/Reykjavik"),//$NON-NLS-1$
+				new SimpleTimeZone(0 * ONE_HOUR, "Atlantic/St_Helena"),//$NON-NLS-1$
+				new SimpleTimeZone(0 * ONE_HOUR, "Europe/Dublin",//$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY, 1 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 1 * ONE_HOUR),
+				new SimpleTimeZone(0 * ONE_HOUR, "Europe/Lisbon",//$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY, 1 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 1 * ONE_HOUR),
+				new SimpleTimeZone(1 * ONE_HOUR, "Africa/Bangui"),//$NON-NLS-1$
+				new SimpleTimeZone(1 * ONE_HOUR, "Africa/Douala"),//$NON-NLS-1$
+				new SimpleTimeZone(1 * ONE_HOUR, "Africa/Kinshasa"),//$NON-NLS-1$
+				new SimpleTimeZone(1 * ONE_HOUR, "Africa/Lagos"),//$NON-NLS-1$
+				new SimpleTimeZone(1 * ONE_HOUR, "Africa/Libreville"),//$NON-NLS-1$
+				new SimpleTimeZone(1 * ONE_HOUR, "Africa/Luanda"),//$NON-NLS-1$
+				new SimpleTimeZone(1 * ONE_HOUR, "Africa/Malabo"),//$NON-NLS-1$
+				new SimpleTimeZone(1 * ONE_HOUR, "Africa/Ndjamena"),//$NON-NLS-1$
+				new SimpleTimeZone(1 * ONE_HOUR, "Africa/Niamey"),//$NON-NLS-1$
+				new SimpleTimeZone(1 * ONE_HOUR, "Africa/Porto-Novo"),//$NON-NLS-1$
+				new SimpleTimeZone(1 * ONE_HOUR, "Africa/Tunis"),//$NON-NLS-1$
+				new SimpleTimeZone(1 * ONE_HOUR, "Africa/Windhoek",//$NON-NLS-1$
+						Calendar.SEPTEMBER, 1, -Calendar.SUNDAY, 2 * ONE_HOUR,
+						Calendar.APRIL, 1, -Calendar.SUNDAY, 2 * ONE_HOUR),
+				new SimpleTimeZone(1 * ONE_HOUR, "Atlantic/Jan_Mayen"),//$NON-NLS-1$
+				new SimpleTimeZone(1 * ONE_HOUR, "Europe/Amsterdam",//$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY, 1 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 1 * ONE_HOUR),
+				new SimpleTimeZone(1 * ONE_HOUR, "Europe/Andorra",//$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY, 1 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 1 * ONE_HOUR),
+				new SimpleTimeZone(1 * ONE_HOUR, "Europe/Belgrade",//$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY, 1 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 1 * ONE_HOUR),
+				new SimpleTimeZone(1 * ONE_HOUR, "Europe/Berlin",//$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY, 1 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 1 * ONE_HOUR),
+				new SimpleTimeZone(1 * ONE_HOUR, "Europe/Brussels",//$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY, 1 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 1 * ONE_HOUR),
+				new SimpleTimeZone(1 * ONE_HOUR, "Europe/Budapest",//$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY, 1 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 1 * ONE_HOUR),
+				new SimpleTimeZone(1 * ONE_HOUR, "Europe/Copenhagen",//$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY, 1 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 1 * ONE_HOUR),
+				new SimpleTimeZone(1 * ONE_HOUR, "Europe/Gibraltar",//$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY, 1 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 1 * ONE_HOUR),
+				new SimpleTimeZone(1 * ONE_HOUR, "Europe/Luxembourg",//$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY, 1 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 1 * ONE_HOUR),
+				new SimpleTimeZone(1 * ONE_HOUR, "Europe/Madrid",//$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY, 1 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 1 * ONE_HOUR),
+				new SimpleTimeZone(1 * ONE_HOUR, "Europe/Malta",//$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY, 1 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 1 * ONE_HOUR),
+				new SimpleTimeZone(1 * ONE_HOUR, "Europe/Monaco",//$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY, 1 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 1 * ONE_HOUR),
+				new SimpleTimeZone(1 * ONE_HOUR, "Europe/Oslo", Calendar.MARCH,//$NON-NLS-1$
+						-1, Calendar.SUNDAY, 1 * ONE_HOUR, Calendar.OCTOBER,
+						-1, Calendar.SUNDAY, 1 * ONE_HOUR),
+				new SimpleTimeZone(1 * ONE_HOUR, "Europe/Paris",//$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY, 1 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 1 * ONE_HOUR),
+				new SimpleTimeZone(1 * ONE_HOUR, "Europe/Prague",//$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY, 1 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 1 * ONE_HOUR),
+				new SimpleTimeZone(1 * ONE_HOUR, "Europe/Rome", Calendar.MARCH,//$NON-NLS-1$
+						-1, Calendar.SUNDAY, 1 * ONE_HOUR, Calendar.OCTOBER,
+						-1, Calendar.SUNDAY, 1 * ONE_HOUR),
+				new SimpleTimeZone(1 * ONE_HOUR, "Europe/Stockholm",//$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY, 1 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 1 * ONE_HOUR),
+				new SimpleTimeZone(1 * ONE_HOUR, "Europe/Tirane",//$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY, 1 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 1 * ONE_HOUR),
+				new SimpleTimeZone(1 * ONE_HOUR, "Europe/Vaduz",//$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY, 1 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 1 * ONE_HOUR),
+				new SimpleTimeZone(1 * ONE_HOUR, "Europe/Vienna",//$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY, 1 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 1 * ONE_HOUR),
+				new SimpleTimeZone(1 * ONE_HOUR, "Europe/Warsaw",//$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY, 1 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 1 * ONE_HOUR),
+				new SimpleTimeZone(1 * ONE_HOUR, "Europe/Zurich",//$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY, 1 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 1 * ONE_HOUR),
+				new SimpleTimeZone(2 * ONE_HOUR, "Africa/Blantyre"),//$NON-NLS-1$
+				new SimpleTimeZone(2 * ONE_HOUR, "Africa/Bujumbura"),//$NON-NLS-1$
+				new SimpleTimeZone(2 * ONE_HOUR, "Africa/Gaborone"),//$NON-NLS-1$
+				new SimpleTimeZone(2 * ONE_HOUR, "Africa/Johannesburg"),//$NON-NLS-1$
+				new SimpleTimeZone(2 * ONE_HOUR, "Africa/Kigali"),//$NON-NLS-1$
+				new SimpleTimeZone(2 * ONE_HOUR, "Africa/Lubumbashi"),//$NON-NLS-1$
+				new SimpleTimeZone(2 * ONE_HOUR, "Africa/Lusaka"),//$NON-NLS-1$
+				new SimpleTimeZone(2 * ONE_HOUR, "Africa/Maputo"),//$NON-NLS-1$
+				new SimpleTimeZone(2 * ONE_HOUR, "Africa/Maseru"),//$NON-NLS-1$
+				new SimpleTimeZone(2 * ONE_HOUR, "Africa/Mbabane"),//$NON-NLS-1$
+				new SimpleTimeZone(2 * ONE_HOUR, "Africa/Tripoli"),//$NON-NLS-1$
+				new SimpleTimeZone(2 * ONE_HOUR, "Asia/Amman", Calendar.MARCH,//$NON-NLS-1$
+						-1, Calendar.THURSDAY, 0 * ONE_HOUR,
+						Calendar.SEPTEMBER, -1, Calendar.THURSDAY, 0 * ONE_HOUR),
+				new SimpleTimeZone(2 * ONE_HOUR, "Asia/Beirut", Calendar.MARCH,//$NON-NLS-1$
+						-1, Calendar.SUNDAY, 0 * ONE_HOUR, Calendar.OCTOBER,
+						-1, Calendar.SUNDAY, 0 * ONE_HOUR),
+				new SimpleTimeZone(2 * ONE_HOUR, "Asia/Damascus",//$NON-NLS-1$
+						Calendar.APRIL, 1, 0, 0 * ONE_HOUR, Calendar.OCTOBER,
+						1, 0, 0 * ONE_HOUR),
+				new SimpleTimeZone(2 * ONE_HOUR, "Asia/Nicosia",//$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY, 1 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 1 * ONE_HOUR),
+				new SimpleTimeZone(2 * ONE_HOUR, "Europe/Athens",//$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY, 1 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 1 * ONE_HOUR),
+				new SimpleTimeZone(2 * ONE_HOUR, "Europe/Chisinau",//$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY, 1 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 1 * ONE_HOUR),
+				new SimpleTimeZone(2 * ONE_HOUR, "Europe/Helsinki",//$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY, 1 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 1 * ONE_HOUR),
+				new SimpleTimeZone(2 * ONE_HOUR, "Europe/Istanbul",//$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY, 1 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 1 * ONE_HOUR),
+				new SimpleTimeZone(2 * ONE_HOUR, "Europe/Kaliningrad",//$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY, 2 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 2 * ONE_HOUR),
+				new SimpleTimeZone(2 * ONE_HOUR, "Europe/Kiev", Calendar.MARCH,//$NON-NLS-1$
+						-1, Calendar.SUNDAY, 1 * ONE_HOUR, Calendar.OCTOBER,
+						-1, Calendar.SUNDAY, 1 * ONE_HOUR),
+				new SimpleTimeZone(2 * ONE_HOUR, "Europe/Minsk",//$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY, 2 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 2 * ONE_HOUR),
+				new SimpleTimeZone(2 * ONE_HOUR, "Europe/Riga", Calendar.MARCH,//$NON-NLS-1$
+						-1, Calendar.SUNDAY, 1 * ONE_HOUR, Calendar.OCTOBER,
+						-1, Calendar.SUNDAY, 1 * ONE_HOUR),
+				new SimpleTimeZone(2 * ONE_HOUR, "Europe/Simferopol",//$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY, 1 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 1 * ONE_HOUR),
+				new SimpleTimeZone(2 * ONE_HOUR, "Europe/Sofia",//$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY, 1 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 1 * ONE_HOUR),
+				new SimpleTimeZone(2 * ONE_HOUR, "Europe/Tallinn"),//$NON-NLS-1$
+				new SimpleTimeZone(2 * ONE_HOUR, "Europe/Vilnius"),//$NON-NLS-1$
+				new SimpleTimeZone(3 * ONE_HOUR, "Africa/Addis_Ababa"),//$NON-NLS-1$
+				new SimpleTimeZone(3 * ONE_HOUR, "Africa/Asmera"),//$NON-NLS-1$
+				new SimpleTimeZone(3 * ONE_HOUR, "Africa/Dar_es_Salaam"),//$NON-NLS-1$
+				new SimpleTimeZone(3 * ONE_HOUR, "Africa/Djibouti"),//$NON-NLS-1$
+				new SimpleTimeZone(3 * ONE_HOUR, "Africa/Kampala"),//$NON-NLS-1$
+				new SimpleTimeZone(3 * ONE_HOUR, "Africa/Khartoum"),//$NON-NLS-1$
+				new SimpleTimeZone(3 * ONE_HOUR, "Africa/Mogadishu"),//$NON-NLS-1$
+				new SimpleTimeZone(3 * ONE_HOUR, "Africa/Nairobi"),//$NON-NLS-1$
+				new SimpleTimeZone(3 * ONE_HOUR, "Asia/Aden"),//$NON-NLS-1$
+				new SimpleTimeZone(3 * ONE_HOUR, "Asia/Baghdad",//$NON-NLS-1$
+						Calendar.APRIL, 1, 0, 3 * ONE_HOUR, Calendar.OCTOBER,
+						1, 0, 3 * ONE_HOUR),
+				new SimpleTimeZone(3 * ONE_HOUR, "Asia/Bahrain"),//$NON-NLS-1$
+				new SimpleTimeZone(3 * ONE_HOUR, "Asia/Kuwait"),//$NON-NLS-1$
+				new SimpleTimeZone(3 * ONE_HOUR, "Asia/Qatar"),//$NON-NLS-1$
+				new SimpleTimeZone(3 * ONE_HOUR, "Asia/Riyadh"),//$NON-NLS-1$
+				new SimpleTimeZone(3 * ONE_HOUR, "Indian/Antananarivo"),//$NON-NLS-1$
+				new SimpleTimeZone(3 * ONE_HOUR, "Indian/Comoro"),//$NON-NLS-1$
+				new SimpleTimeZone(3 * ONE_HOUR, "Indian/Mayotte"),//$NON-NLS-1$
+				new SimpleTimeZone(4 * ONE_HOUR, "Asia/Aqtau", Calendar.MARCH,//$NON-NLS-1$
+						-1, Calendar.SUNDAY, 0 * ONE_HOUR, Calendar.OCTOBER,
+						-1, Calendar.SUNDAY, 0 * ONE_HOUR),
+				new SimpleTimeZone(4 * ONE_HOUR, "Asia/Baku", Calendar.MARCH,//$NON-NLS-1$
+						-1, Calendar.SUNDAY, 1 * ONE_HOUR, Calendar.OCTOBER,
+						-1, Calendar.SUNDAY, 1 * ONE_HOUR),
+				new SimpleTimeZone(4 * ONE_HOUR, "Asia/Muscat"),//$NON-NLS-1$
+				new SimpleTimeZone(4 * ONE_HOUR, "Asia/Tbilisi",//$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY, 0 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 0 * ONE_HOUR),
+				new SimpleTimeZone(4 * ONE_HOUR, "Asia/Yerevan",//$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY, 2 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 2 * ONE_HOUR),
+				new SimpleTimeZone(4 * ONE_HOUR, "Europe/Samara",//$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY, 2 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 2 * ONE_HOUR),
+				new SimpleTimeZone(4 * ONE_HOUR, "Indian/Mahe"),//$NON-NLS-1$
+				new SimpleTimeZone(4 * ONE_HOUR, "Indian/Mauritius"),//$NON-NLS-1$
+				new SimpleTimeZone(4 * ONE_HOUR, "Indian/Reunion"),//$NON-NLS-1$
+				new SimpleTimeZone(5 * ONE_HOUR, "Asia/Aqtobe", Calendar.MARCH,//$NON-NLS-1$
+						-1, Calendar.SUNDAY, 0 * ONE_HOUR, Calendar.OCTOBER,
+						-1, Calendar.SUNDAY, 0 * ONE_HOUR),
+				new SimpleTimeZone(5 * ONE_HOUR, "Asia/Ashgabat"),//$NON-NLS-1$
+				new SimpleTimeZone(5 * ONE_HOUR, "Asia/Ashkhabad"),//$NON-NLS-1$
+				new SimpleTimeZone(5 * ONE_HOUR, "Asia/Bishkek",//$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY,
+						2 * ONE_HOUR + 1800000, Calendar.OCTOBER, -1,
+						Calendar.SUNDAY, 2 * ONE_HOUR + 1800000),
+				new SimpleTimeZone(5 * ONE_HOUR, "Asia/Dushanbe"),//$NON-NLS-1$
+				new SimpleTimeZone(5 * ONE_HOUR, "Asia/Karachi"),//$NON-NLS-1$
+				new SimpleTimeZone(5 * ONE_HOUR, "Asia/Tashkent"),//$NON-NLS-1$
+				new SimpleTimeZone(5 * ONE_HOUR, "Asia/Yekaterinburg",//$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY, 2 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 2 * ONE_HOUR),
+				new SimpleTimeZone(5 * ONE_HOUR, "Indian/Kerguelen"),//$NON-NLS-1$
+				new SimpleTimeZone(5 * ONE_HOUR, "Indian/Maldives"),//$NON-NLS-1$
+				new SimpleTimeZone(5 * ONE_HOUR + 1800000, "Asia/Calcutta"),//$NON-NLS-1$
+				new SimpleTimeZone(6 * ONE_HOUR, "Antarctica/Mawson"),//$NON-NLS-1$
+				new SimpleTimeZone(6 * ONE_HOUR, "Asia/Almaty", Calendar.MARCH,//$NON-NLS-1$
+						-1, Calendar.SUNDAY, 0 * ONE_HOUR, Calendar.OCTOBER,
+						-1, Calendar.SUNDAY, 0 * ONE_HOUR),
+				new SimpleTimeZone(6 * ONE_HOUR, "Asia/Colombo"),//$NON-NLS-1$
+				new SimpleTimeZone(6 * ONE_HOUR, "Asia/Dacca"),//$NON-NLS-1$
+				new SimpleTimeZone(6 * ONE_HOUR, "Asia/Dhaka"),//$NON-NLS-1$
+				new SimpleTimeZone(6 * ONE_HOUR, "Asia/Novosibirsk",//$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY, 2 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 2 * ONE_HOUR),
+				new SimpleTimeZone(6 * ONE_HOUR, "Asia/Thimbu"),//$NON-NLS-1$
+				new SimpleTimeZone(6 * ONE_HOUR, "Asia/Thimphu"),//$NON-NLS-1$
+				new SimpleTimeZone(6 * ONE_HOUR, "Indian/Chagos"),//$NON-NLS-1$
+				new SimpleTimeZone(6 * ONE_HOUR + 1800000, "Indian/Cocos"),//$NON-NLS-1$
+				new SimpleTimeZone(7 * ONE_HOUR, "Asia/Bangkok"),//$NON-NLS-1$
+				new SimpleTimeZone(7 * ONE_HOUR, "Asia/Jakarta"),//$NON-NLS-1$
+				new SimpleTimeZone(7 * ONE_HOUR, "Asia/Krasnoyarsk",//$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY, 2 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 2 * ONE_HOUR),
+				new SimpleTimeZone(7 * ONE_HOUR, "Asia/Phnom_Penh"),//$NON-NLS-1$
+				new SimpleTimeZone(7 * ONE_HOUR, "Asia/Saigon"),//$NON-NLS-1$
+				new SimpleTimeZone(7 * ONE_HOUR, "Asia/Vientiane"),//$NON-NLS-1$
+				new SimpleTimeZone(7 * ONE_HOUR, "Indian/Christmas"),//$NON-NLS-1$
+				new SimpleTimeZone(8 * ONE_HOUR, "Antarctica/Casey"),//$NON-NLS-1$
+				new SimpleTimeZone(8 * ONE_HOUR, "Asia/Brunei"),//$NON-NLS-1$
+				new SimpleTimeZone(8 * ONE_HOUR, "Asia/Hong_Kong"),//$NON-NLS-1$
+				new SimpleTimeZone(8 * ONE_HOUR, "Asia/Irkutsk",//$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY, 2 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 2 * ONE_HOUR),
+				new SimpleTimeZone(8 * ONE_HOUR, "Asia/Kuala_Lumpur"),//$NON-NLS-1$
+				new SimpleTimeZone(8 * ONE_HOUR, "Asia/Macao"),//$NON-NLS-1$
+				new SimpleTimeZone(8 * ONE_HOUR, "Asia/Manila"),//$NON-NLS-1$
+				new SimpleTimeZone(8 * ONE_HOUR, "Asia/Shanghai"),//$NON-NLS-1$
+				new SimpleTimeZone(8 * ONE_HOUR, "Asia/Singapore"),//$NON-NLS-1$
+				new SimpleTimeZone(8 * ONE_HOUR, "Asia/Taipei"),//$NON-NLS-1$
+				new SimpleTimeZone(8 * ONE_HOUR, "Asia/Ujung_Pandang"),//$NON-NLS-1$
+				new SimpleTimeZone(8 * ONE_HOUR, "Asia/Ulaanbaatar"),//$NON-NLS-1$
+				new SimpleTimeZone(8 * ONE_HOUR, "Asia/Ulan_Bator"),//$NON-NLS-1$
+				new SimpleTimeZone(8 * ONE_HOUR, "Australia/Perth"),//$NON-NLS-1$
+				new SimpleTimeZone(9 * ONE_HOUR, "Asia/Jayapura"),//$NON-NLS-1$
+				new SimpleTimeZone(9 * ONE_HOUR, "Asia/Pyongyang"),//$NON-NLS-1$
+				new SimpleTimeZone(9 * ONE_HOUR, "Asia/Seoul"),//$NON-NLS-1$
+				new SimpleTimeZone(9 * ONE_HOUR, "Asia/Tokyo"),//$NON-NLS-1$
+				new SimpleTimeZone(9 * ONE_HOUR, "Asia/Yakutsk",//$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY, 2 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 2 * ONE_HOUR),//$NON-NLS-1$
+				new SimpleTimeZone(9 * ONE_HOUR, "Pacific/Palau"),//$NON-NLS-1$
+				new SimpleTimeZone(9 * ONE_HOUR + 1800000,
+						"Australia/Broken_Hill", Calendar.OCTOBER, -1,//$NON-NLS-1$
+						Calendar.SUNDAY, 2 * ONE_HOUR, Calendar.MARCH, -1,
+						Calendar.SUNDAY, 2 * ONE_HOUR),
+				new SimpleTimeZone(9 * ONE_HOUR + 1800000, "Australia/Darwin"),//$NON-NLS-1$
+				new SimpleTimeZone(10 * ONE_HOUR, "Antarctica/DumontDUrville"),//$NON-NLS-1$
+				new SimpleTimeZone(10 * ONE_HOUR, "Asia/Vladivostok",//$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY, 2 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 2 * ONE_HOUR),
+				new SimpleTimeZone(10 * ONE_HOUR, "Australia/Sydney",//$NON-NLS-1$
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 2 * ONE_HOUR,
+						Calendar.MARCH, -1, Calendar.SUNDAY, 2 * ONE_HOUR),
+				new SimpleTimeZone(10 * ONE_HOUR, "Pacific/Guam"),//$NON-NLS-1$
+				new SimpleTimeZone(10 * ONE_HOUR, "Pacific/Port_Moresby"),//$NON-NLS-1$
+				new SimpleTimeZone(10 * ONE_HOUR, "Pacific/Saipan"),//$NON-NLS-1$
+				new SimpleTimeZone(10 * ONE_HOUR, "Pacific/Truk"),//$NON-NLS-1$
+				new SimpleTimeZone(10 * ONE_HOUR + 1800000,
+						"Australia/Lord_Howe", Calendar.OCTOBER, -1,//$NON-NLS-1$
+						Calendar.SUNDAY, 2 * ONE_HOUR, Calendar.MARCH, -1,
+						Calendar.SUNDAY, 2 * ONE_HOUR, 1800000),
+				new SimpleTimeZone(11 * ONE_HOUR, "Asia/Magadan",//$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY, 2 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 2 * ONE_HOUR),
+				new SimpleTimeZone(11 * ONE_HOUR, "Pacific/Efate"),//$NON-NLS-1$
+				new SimpleTimeZone(11 * ONE_HOUR, "Pacific/Guadalcanal"),//$NON-NLS-1$
+				new SimpleTimeZone(11 * ONE_HOUR, "Pacific/Kosrae"),//$NON-NLS-1$
+				new SimpleTimeZone(11 * ONE_HOUR, "Pacific/Noumea"),//$NON-NLS-1$
+				new SimpleTimeZone(11 * ONE_HOUR, "Pacific/Ponape"),//$NON-NLS-1$
+				new SimpleTimeZone(11 * ONE_HOUR + 1800000, "Pacific/Norfolk"),//$NON-NLS-1$
+				new SimpleTimeZone(12 * ONE_HOUR, "Antarctica/McMurdo",//$NON-NLS-1$
+						Calendar.OCTOBER, 1, -Calendar.SUNDAY, 2 * ONE_HOUR,
+						Calendar.MARCH, 15, -Calendar.SUNDAY, 2 * ONE_HOUR),
+				new SimpleTimeZone(12 * ONE_HOUR, "Asia/Anadyr",//$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY, 2 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 2 * ONE_HOUR),
+				new SimpleTimeZone(12 * ONE_HOUR, "Asia/Kamchatka",//$NON-NLS-1$
+						Calendar.MARCH, -1, Calendar.SUNDAY, 2 * ONE_HOUR,
+						Calendar.OCTOBER, -1, Calendar.SUNDAY, 2 * ONE_HOUR),
+				new SimpleTimeZone(12 * ONE_HOUR, "Pacific/Auckland",//$NON-NLS-1$
+						Calendar.OCTOBER, 1, -Calendar.SUNDAY, 2 * ONE_HOUR,
+						Calendar.MARCH, 15, -Calendar.SUNDAY, 2 * ONE_HOUR),
+				new SimpleTimeZone(12 * ONE_HOUR, "Pacific/Fiji"),//$NON-NLS-1$
+				new SimpleTimeZone(12 * ONE_HOUR, "Pacific/Funafuti"),//$NON-NLS-1$
+				new SimpleTimeZone(12 * ONE_HOUR, "Pacific/Majuro"),//$NON-NLS-1$
+				new SimpleTimeZone(12 * ONE_HOUR, "Pacific/Nauru"),//$NON-NLS-1$
+				new SimpleTimeZone(12 * ONE_HOUR, "Pacific/Tarawa"),//$NON-NLS-1$
+				new SimpleTimeZone(12 * ONE_HOUR, "Pacific/Wake"),//$NON-NLS-1$
+				new SimpleTimeZone(12 * ONE_HOUR, "Pacific/Wallis"),//$NON-NLS-1$
+				new SimpleTimeZone(13 * ONE_HOUR, "Pacific/Enderbury"),//$NON-NLS-1$
+				new SimpleTimeZone(13 * ONE_HOUR, "Pacific/Tongatapu"),//$NON-NLS-1$
+				new SimpleTimeZone(14 * ONE_HOUR, "Pacific/Kiritimati"), };//$NON-NLS-1$
+	}
+}

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/util/Timer.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/util/Timer.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/util/Timer.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/util/Timer.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,459 @@
+/* Copyright 2000, 2003 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.util;
+
+
+import com.ibm.oti.util.Msg;
+
+/**
+ * Timers are used to schedule jobs for execution in a background process. A
+ * single thread is used for the scheduling and this thread has the option of
+ * being a daemon thread. By calling <code>cancel</code> you can terminate a
+ * timer and it's associated thread. All tasks which are scheduled to run after
+ * this point are cancelled. Tasks are executed sequentially but are subject to
+ * the delays from other tasks run methods. If a specific task takes an
+ * excessive amount of time to run it may impact the time at which subsequent
+ * tasks may run.
+ * <p>
+ * 
+ * The Timer task does not offer any guarantees about the real-time nature of
+ * scheduling tasks as it's underlying implementation relies on the
+ * <code>Object.wait(long)</code> method.
+ * <p>
+ * 
+ * Multiple threads can share a single Timer without the need for their own
+ * synchronization.
+ * 
+ * @see TimerTask
+ * @see java.lang.Object#wait(long)
+ */
+public class Timer {
+
+	private static final class TimerImpl extends Thread {
+
+		private static final class TimerNode {
+			TimerNode parent, left, right;
+
+			TimerTask task;
+
+			public TimerNode(TimerTask value) {
+				this.task = value;
+			}
+		}
+
+		private static final class TimerTree {
+			TimerNode root;
+
+			boolean isEmpty() {
+				return root == null;
+			}
+
+			void insert(TimerNode z) {
+				TimerNode y = null, x = root;
+				while (x != null) {
+					y = x;
+					if (z.task.when < x.task.when)
+						x = x.left;
+					else
+						x = x.right;
+				}
+				z.parent = y;
+				if (y == null)
+					root = z;
+				else if (z.task.when < y.task.when)
+					y.left = z;
+				else
+					y.right = z;
+			}
+
+			void delete(TimerNode z) {
+				TimerNode y = null, x = null;
+				if (z.left == null || z.right == null)
+					y = z;
+				else
+					y = successor(z);
+				if (y.left != null)
+					x = y.left;
+				else
+					x = y.right;
+				if (x != null)
+					x.parent = y.parent;
+				if (y.parent == null)
+					root = x;
+				else if (y == y.parent.left)
+					y.parent.left = x;
+				else
+					y.parent.right = x;
+				if (y != z)
+					z.task = y.task;
+			}
+
+			private TimerNode successor(TimerNode x) {
+				if (x.right != null)
+					return minimum(x.right);
+				TimerNode y = x.parent;
+				while (y != null && x == y.right) {
+					x = y;
+					y = y.parent;
+				}
+				return y;
+			}
+
+			private TimerNode minimum(TimerNode x) {
+				while (x.left != null)
+					x = x.left;
+				return x;
+			}
+
+			TimerNode minimum() {
+				return minimum(root);
+			}
+		}
+
+		/**
+		 * True if the method cancel() of the Timer was called or the !!!stop()
+		 * method was invoked
+		 */
+		private boolean cancelled = false;
+
+		/**
+		 * True if the Timer has become garbage
+		 */
+		private boolean finished = false;
+
+		/**
+		 * Vector consists of scheduled events, sorted according to
+		 * <code>when</code> field of TaskScheduled object.
+		 */
+		private TimerTree tasks = new TimerTree();
+
+		/**
+		 * Starts a new timer.
+		 * 
+		 * @param isDaemon
+		 */
+		TimerImpl(boolean isDaemon) {
+			this.setDaemon(isDaemon);
+			this.start();
+		}
+
+		/**
+		 * This method will be launched on separate thread for each Timer
+		 * object.
+		 */
+		public void run() {
+
+			while (true) {
+				TimerTask task;
+				synchronized (this) {
+					// need to check cancelled inside the synchronized block
+					if (cancelled)
+						return;
+					if (tasks.isEmpty()) {
+						if (finished)
+							return;
+						// no tasks scheduled -- sleep until any task appear
+						try {
+							this.wait();
+						} catch (Exception e) {
+						}
+						continue;
+					}
+
+					long currentTime = System.currentTimeMillis();
+
+					TimerNode taskNode = tasks.minimum();
+					task = taskNode.task;
+					if (task.isCancelled()) {
+						tasks.delete(taskNode);
+						continue;
+					}
+
+					// check the time to sleep for the first task scheduled
+					long timeToSleep = task.when - currentTime;
+
+					if (timeToSleep > 0) {
+						// sleep!
+						try {
+							this.wait(timeToSleep);
+						} catch (Exception e) {
+						}
+						continue;
+					}
+
+					// no sleep is necessary before launching the task
+
+					// set time to schedule
+					task.setScheduledTime(task.when);
+
+					// remove task from queue
+					tasks.delete(taskNode);
+
+					// set when the next task should be launched
+					if (task.period >= 0) {
+						// this is a repeating task,
+						if (task.fixedRate) {
+							// task is scheduled at fixed rate
+							task.when = task.when + task.period;
+						} else {
+							// task is scheduled at fixed delay
+							task.when = System.currentTimeMillis()
+									+ task.period;
+						}
+
+						// insert this task into queue
+						insertTask(task);
+					} else
+						task.when = 0;
+				}
+
+				// run the task
+				try {
+					task.run();
+				} catch (Exception e) {
+				}
+			}
+		}
+
+		private void insertTask(TimerTask newTask) {
+			// callers are synchronized
+			tasks.insert(new TimerNode(newTask));
+			this.notify();
+		}
+
+		/**
+		 * Cancels timer.
+		 */
+		public synchronized void cancel() {
+			cancelled = true;
+			tasks = new TimerTree();
+			this.notify();
+		}
+	}
+
+	/* This object will be used in synchronization purposes */
+	private TimerImpl impl;
+
+	// Used to finalize thread
+	private Object finalizer = new Object() {
+		public void finalize() {
+			synchronized (impl) {
+				impl.finished = true;
+				impl.notify();
+			}
+		}
+	};
+
+	/**
+	 * Creates a new Timer which may be specified to be run as a Daemon Thread.
+	 * 
+	 * @param isDaemon
+	 *            true if Timers thread should be a daemon thread.
+	 */
+	public Timer(boolean isDaemon) {
+		impl = new TimerImpl(isDaemon);
+	}
+
+	/**
+	 * Creates a new non-daemon Timer.
+	 */
+	public Timer() {
+		impl = new TimerImpl(false);
+	}
+
+	/**
+	 * Cancels the Timer and removed any scheduled tasks. If there is a
+	 * currently running task it is not effected. No more tasks may be scheduled
+	 * on this Timer. Subsequent calls do nothing.
+	 */
+	public void cancel() {
+		impl.cancel();
+	}
+
+	/**
+	 * Schedule a task for single execution. If when is less than the current
+	 * time, it will be scheduled to executed as soon as possible.
+	 * 
+	 * @param task
+	 *            The task to schedule
+	 * @param when
+	 *            Time of execution
+	 * 
+	 * @exception IllegalArgumentException
+	 *                if when.getTime() < 0
+	 * @exception IllegalStateException
+	 *                if the timer has been cancelled, the task has been
+	 *                scheduled or cancelled.
+	 */
+	public void schedule(TimerTask task, Date when) {
+		if (when.getTime() < 0)
+			throw new IllegalArgumentException();
+		long delay = when.getTime() - System.currentTimeMillis();
+		scheduleImpl(task, delay < 0 ? 0 : delay, -1, false);
+	}
+
+	/**
+	 * Schedule a task for single execution after a specific delay.
+	 * 
+	 * @param task
+	 *            The task to schedule
+	 * @param delay
+	 *            Amount of time before execution
+	 * 
+	 * @exception IllegalArgumentException
+	 *                if delay < 0
+	 * @exception IllegalStateException
+	 *                if the timer has been cancelled, the task has been
+	 *                scheduled or cancelled.
+	 */
+	public void schedule(TimerTask task, long delay) {
+		if (delay < 0)
+			throw new IllegalArgumentException();
+		scheduleImpl(task, delay, -1, false);
+	}
+
+	/**
+	 * Schedule a task for repeated fix-delay execution after a specific delay.
+	 * 
+	 * @param task
+	 *            The task to schedule
+	 * @param delay
+	 *            Amount of time before first execution
+	 * @param period
+	 *            Amount of time between subsequent executions
+	 * 
+	 * @exception IllegalArgumentException
+	 *                if delay < 0 or period < 0
+	 * @exception IllegalStateException
+	 *                if the timer has been cancelled, the task has been
+	 *                scheduled or cancelled.
+	 */
+	public void schedule(TimerTask task, long delay, long period) {
+		if (delay < 0 || period <= 0)
+			throw new IllegalArgumentException();
+		scheduleImpl(task, delay, period, false);
+	}
+
+	/**
+	 * Schedule a task for repeated fix-delay execution after a specific time
+	 * has been reached.
+	 * 
+	 * @param task
+	 *            The task to schedule
+	 * @param when
+	 *            Time of first execution
+	 * @param period
+	 *            Amount of time between subsequent executions
+	 * 
+	 * @exception IllegalArgumentException
+	 *                if when.getTime() < 0 or period < 0
+	 * @exception IllegalStateException
+	 *                if the timer has been cancelled, the task has been
+	 *                scheduled or cancelled.
+	 */
+	public void schedule(TimerTask task, Date when, long period) {
+		if (period <= 0 || when.getTime() < 0) {
+			throw new IllegalArgumentException();
+		}
+		long delay = when.getTime() - System.currentTimeMillis();
+		scheduleImpl(task, delay < 0 ? 0 : delay, period, false);
+	}
+
+	/**
+	 * Schedule a task for repeated fixed-rate execution after a specific delay
+	 * has been happened. The difference of fixed-rate is that it may bunch up
+	 * subsequent task runs to try to get the task repeating at it's desired
+	 * time.
+	 * 
+	 * @param task
+	 *            The task to schedule
+	 * @param delay
+	 *            Amount of time before first execution
+	 * @param period
+	 *            Amount of time between subsequent executions
+	 * 
+	 * @exception IllegalArgumentException
+	 *                if delay < 0 or period < 0
+	 * @exception IllegalStateException
+	 *                if the timer has been cancelled, the task has been
+	 *                scheduled or cancelled.
+	 */
+	public void scheduleAtFixedRate(TimerTask task, long delay, long period) {
+		if (delay < 0 || period <= 0)
+			throw new IllegalArgumentException();
+		scheduleImpl(task, delay, period, true);
+	}
+
+	/**
+	 * Schedule a task for repeated fixed-rate execution after a specific time
+	 * has been reached. The difference of fixed-rate is that it may bunch up
+	 * subsequent task runs to try to get the task repeating at it's desired
+	 * time.
+	 * 
+	 * @param task
+	 *            The task to schedule
+	 * @param when
+	 *            Time of first execution
+	 * @param period
+	 *            Amount of time between subsequent executions
+	 * 
+	 * @exception IllegalArgumentException
+	 *                if when.getTime() < 0 or period < 0
+	 * @exception IllegalStateException
+	 *                if the timer has been cancelled, the task has been
+	 *                scheduled or cancelled.
+	 */
+	public void scheduleAtFixedRate(TimerTask task, Date when, long period) {
+		if (period <= 0 || when.getTime() < 0)
+			throw new IllegalArgumentException();
+		long delay = when.getTime() - System.currentTimeMillis();
+		scheduleImpl(task, delay < 0 ? 0 : delay, period, true);
+	}
+
+	/**
+	 * Schedule a task.
+	 * 
+	 * @param task
+	 * @param delay
+	 * @param period
+	 * @param fixed
+	 */
+	private void scheduleImpl(TimerTask task, long delay, long period,
+			boolean fixed) {
+		synchronized (impl) {
+			if (impl.cancelled)
+				throw new IllegalStateException(Msg.getString("K00f3")); //$NON-NLS-1$
+
+			long when = delay + System.currentTimeMillis();
+
+			if (when < 0)
+				throw new IllegalArgumentException(Msg.getString("K00f5")); //$NON-NLS-1$
+
+			if (task.isScheduled())
+				throw new IllegalStateException(Msg.getString("K00f6")); //$NON-NLS-1$
+
+			if (task.isCancelled())
+				throw new IllegalStateException(Msg.getString("K00f7")); //$NON-NLS-1$
+
+			task.when = when;
+			task.period = period;
+			task.fixedRate = fixed;
+
+			// insert the newTask into queue
+			impl.insertTask(task);
+		}
+	}
+}



Mime
View raw message