KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > util > spi > TimeZoneNameProvider


1 /*
2  * @(#)TimeZoneNameProvider.java 1.2 05/11/17
3  *
4  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package java.util.spi;
9
10 import java.util.Locale JavaDoc;
11
12 /**
13  * An abstract class for service providers that
14  * provide localized time zone names for the
15  * {@link java.util.TimeZone TimeZone} class.
16  * The localized time zone names available from the implementations of
17  * this class are also the source for the
18  * {@link java.text.DateFormatSymbols#getZoneStrings()
19  * DateFormatSymbols.getZoneStrings()} method.
20  *
21  * @since 1.6
22  * @version @(#)TimeZoneNameProvider.java 1.2 05/11/17
23  */

24 public abstract class TimeZoneNameProvider extends LocaleServiceProvider {
25
26     /**
27      * Sole constructor. (For invocation by subclass constructors, typically
28      * implicit.)
29      */

30     protected TimeZoneNameProvider() {
31     }
32
33     /**
34      * Returns a name for the given time zone ID that's suitable for
35      * presentation to the user in the specified locale. The given time
36      * zone ID is "GMT" or one of the names defined using "Zone" entries
37      * in the "tz database", a public domain time zone database at
38      * <a HREF="ftp://elsie.nci.nih.gov/pub/">ftp://elsie.nci.nih.gov/pub/</a>.
39      * The data of this database is contained in a file whose name starts with
40      * "tzdata", and the specification of the data format is part of the zic.8
41      * man page, which is contained in a file whose name starts with "tzcode".
42      * <p>
43      * If <code>daylight</code> is true, the method should return a name
44      * appropriate for daylight saving time even if the specified time zone
45      * has not observed daylight saving time in the past.
46      *
47      * @param ID a time zone ID string
48      * @param daylight if true, return the daylight saving name.
49      * @param style either {@link java.util.TimeZone#LONG TimeZone.LONG} or
50      * {@link java.util.TimeZone#SHORT TimeZone.SHORT}
51      * @param locale the desired locale
52      * @return the human-readable name of the given time zone in the
53      * given locale, or null if it's not available.
54      * @exception IllegalArgumentException if <code>style</code> is invalid,
55      * or <code>locale</code> isn't one of the locales returned from
56      * {@link java.util.spi.LocaleServiceProvider#getAvailableLocales()
57      * getAvailableLocales()}.
58      * @exception NullPointerException if <code>ID</code> or <code>locale</code>
59      * is null
60      * @see java.util.TimeZone#getDisplayName(boolean, int, java.util.Locale)
61      */

62     public abstract String JavaDoc getDisplayName(String JavaDoc ID, boolean daylight, int style, Locale JavaDoc locale);
63 }
64
Popular Tags