KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > text > spi > DateFormatProvider


1 /*
2  * @(#)DateFormatProvider.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.text.spi;
9
10 import java.text.DateFormat JavaDoc;
11 import java.util.Locale JavaDoc;
12 import java.util.spi.LocaleServiceProvider;
13
14 /**
15  * An abstract class for service providers that
16  * provide concrete implementations of the
17  * {@link java.text.DateFormat DateFormat} class.
18  *
19  * @since 1.6
20  * @version @(#)DateFormatProvider.java 1.2 05/11/17
21  */

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

28     protected DateFormatProvider() {
29     }
30
31     /**
32      * Returns a new <code>DateFormat</code> instance which formats time
33      * with the given formatting style for the specified locale.
34      * @param style the given formatting style. Either one of
35      * {@link java.text.DateFormat#SHORT DateFormat.SHORT},
36      * {@link java.text.DateFormat#MEDIUM DateFormat.MEDIUM},
37      * {@link java.text.DateFormat#LONG DateFormat.LONG}, or
38      * {@link java.text.DateFormat#FULL DateFormat.FULL}.
39      * @param locale the desired locale.
40      * @exception IllegalArgumentException if <code>style</code> is invalid,
41      * or if <code>locale</code> isn't
42      * one of the locales returned from
43      * {@link java.util.spi.LocaleServiceProvider#getAvailableLocales()
44      * getAvailableLocales()}.
45      * @exception NullPointerException if <code>locale</code> is null
46      * @return a time formatter.
47      * @see java.text.DateFormat#getTimeInstance(int, java.util.Locale)
48      */

49     public abstract DateFormat JavaDoc getTimeInstance(int style, Locale JavaDoc locale);
50
51     /**
52      * Returns a new <code>DateFormat</code> instance which formats date
53      * with the given formatting style for the specified locale.
54      * @param style the given formatting style. Either one of
55      * {@link java.text.DateFormat#SHORT DateFormat.SHORT},
56      * {@link java.text.DateFormat#MEDIUM DateFormat.MEDIUM},
57      * {@link java.text.DateFormat#LONG DateFormat.LONG}, or
58      * {@link java.text.DateFormat#FULL DateFormat.FULL}.
59      * @param locale the desired locale.
60      * @exception IllegalArgumentException if <code>style</code> is invalid,
61      * or if <code>locale</code> isn't
62      * one of the locales returned from
63      * {@link java.util.spi.LocaleServiceProvider#getAvailableLocales()
64      * getAvailableLocales()}.
65      * @exception NullPointerException if <code>locale</code> is null
66      * @return a date formatter.
67      * @see java.text.DateFormat#getDateInstance(int, java.util.Locale)
68      */

69     public abstract DateFormat JavaDoc getDateInstance(int style, Locale JavaDoc locale);
70
71     /**
72      * Returns a new <code>DateFormat</code> instance which formats date and time
73      * with the given formatting style for the specified locale.
74      * @param dateStyle the given date formatting style. Either one of
75      * {@link java.text.DateFormat#SHORT DateFormat.SHORT},
76      * {@link java.text.DateFormat#MEDIUM DateFormat.MEDIUM},
77      * {@link java.text.DateFormat#LONG DateFormat.LONG}, or
78      * {@link java.text.DateFormat#FULL DateFormat.FULL}.
79      * @param timeStyle the given time formatting style. Either one of
80      * {@link java.text.DateFormat#SHORT DateFormat.SHORT},
81      * {@link java.text.DateFormat#MEDIUM DateFormat.MEDIUM},
82      * {@link java.text.DateFormat#LONG DateFormat.LONG}, or
83      * {@link java.text.DateFormat#FULL DateFormat.FULL}.
84      * @param locale the desired locale.
85      * @exception IllegalArgumentException if <code>dateStyle</code> or
86      * <code>timeStyle</code> is invalid,
87      * or if <code>locale</code> isn't
88      * one of the locales returned from
89      * {@link java.util.spi.LocaleServiceProvider#getAvailableLocales()
90      * getAvailableLocales()}.
91      * @exception NullPointerException if <code>locale</code> is null
92      * @return a date/time formatter.
93      * @see java.text.DateFormat#getDateTimeInstance(int, int, java.util.Locale)
94      */

95     public abstract DateFormat JavaDoc
96         getDateTimeInstance(int dateStyle, int timeStyle, Locale JavaDoc locale);
97 }
98
Popular Tags