author | naoto |
Mon, 01 Apr 2019 08:21:45 -0700 | |
changeset 54360 | 6a4abdb6749c |
parent 47216 | 71c04702a3d5 |
child 58288 | 48e480e56aad |
permissions | -rw-r--r-- |
14502
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
1 |
/* |
54360
6a4abdb6749c
8174268: Declare a public field in JapaneseEra for the era starting May 2019
naoto
parents:
47216
diff
changeset
|
2 |
* Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved. |
14502
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
4 |
* |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. Oracle designates this |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
8 |
* particular file as subject to the "Classpath" exception as provided |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
9 |
* by Oracle in the LICENSE file that accompanied this code. |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
10 |
* |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
15 |
* accompanied this code). |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
16 |
* |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
17 |
* You should have received a copy of the GNU General Public License version |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
20 |
* |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
22 |
* or visit www.oracle.com if you need additional information or have any |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
23 |
* questions. |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
24 |
*/ |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
25 |
|
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
26 |
package java.util.spi; |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
27 |
|
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
28 |
import java.util.Calendar; |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
29 |
import java.util.Locale; |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
30 |
import java.util.Map; |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
31 |
|
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
32 |
/** |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
33 |
* An abstract class for service providers that provide localized string |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
34 |
* representations (display names) of {@code Calendar} field values. |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
35 |
* |
44844
b2b4d98404ba
8179364: update "<a name=" in java.base module to use id attribute
jjg
parents:
25859
diff
changeset
|
36 |
* <p><a id="calendartypes"><b>Calendar Types</b></a> |
14502
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
37 |
* |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
38 |
* <p>Calendar types are used to specify calendar systems for which the {@link |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
39 |
* #getDisplayName(String, int, int, int, Locale) getDisplayName} and {@link |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
40 |
* #getDisplayNames(String, int, int, Locale) getDisplayNames} methods provide |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
41 |
* calendar field value names. See {@link Calendar#getCalendarType()} for details. |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
42 |
* |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
43 |
* <p><b>Calendar Fields</b> |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
44 |
* |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
45 |
* <p>Calendar fields are specified with the constants defined in {@link |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
46 |
* Calendar}. The following are calendar-common fields and their values to be |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
47 |
* supported for each calendar system. |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
48 |
* |
46900
e92e67ed12b4
8186466: Fix accessibility and other minor issues in java.base
jjg
parents:
45437
diff
changeset
|
49 |
* <table class="striped"> |
45124
144479e89cdb
8179592: Update tables in java.base to be HTML 5-friendly.
jjg
parents:
44844
diff
changeset
|
50 |
* <caption style="display:none">Field values</caption> |
144479e89cdb
8179592: Update tables in java.base to be HTML 5-friendly.
jjg
parents:
44844
diff
changeset
|
51 |
* <thead> |
14502
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
52 |
* <tr> |
46900
e92e67ed12b4
8186466: Fix accessibility and other minor issues in java.base
jjg
parents:
45437
diff
changeset
|
53 |
* <th scope="col">Field</th> |
e92e67ed12b4
8186466: Fix accessibility and other minor issues in java.base
jjg
parents:
45437
diff
changeset
|
54 |
* <th scope="col">Value</th> |
e92e67ed12b4
8186466: Fix accessibility and other minor issues in java.base
jjg
parents:
45437
diff
changeset
|
55 |
* <th scope="col">Description</th> |
14502
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
56 |
* </tr> |
45124
144479e89cdb
8179592: Update tables in java.base to be HTML 5-friendly.
jjg
parents:
44844
diff
changeset
|
57 |
* </thead> |
144479e89cdb
8179592: Update tables in java.base to be HTML 5-friendly.
jjg
parents:
44844
diff
changeset
|
58 |
* <tbody> |
14502
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
59 |
* <tr> |
46900
e92e67ed12b4
8186466: Fix accessibility and other minor issues in java.base
jjg
parents:
45437
diff
changeset
|
60 |
* <th scope="row" style="vertical-align:top">{@link Calendar#MONTH}</th> |
45437 | 61 |
* <td style="vertical-align:top">{@link Calendar#JANUARY} to {@link Calendar#UNDECIMBER}</td> |
14502
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
62 |
* <td>Month numbering is 0-based (e.g., 0 - January, ..., 11 - |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
63 |
* December). Some calendar systems have 13 months. Month |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
64 |
* names need to be supported in both the formatting and |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
65 |
* stand-alone forms if required by the supported locales. If there's |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
66 |
* no distinction in the two forms, the same names should be returned |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
67 |
* in both of the forms.</td> |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
68 |
* </tr> |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
69 |
* <tr> |
46900
e92e67ed12b4
8186466: Fix accessibility and other minor issues in java.base
jjg
parents:
45437
diff
changeset
|
70 |
* <th scope="row" style="vertical-align:top">{@link Calendar#DAY_OF_WEEK}</th> |
45437 | 71 |
* <td style="vertical-align:top">{@link Calendar#SUNDAY} to {@link Calendar#SATURDAY}</td> |
14502
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
72 |
* <td>Day-of-week numbering is 1-based starting from Sunday (i.e., 1 - Sunday, |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
73 |
* ..., 7 - Saturday).</td> |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
74 |
* </tr> |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
75 |
* <tr> |
46900
e92e67ed12b4
8186466: Fix accessibility and other minor issues in java.base
jjg
parents:
45437
diff
changeset
|
76 |
* <th scope="row" style="vertical-align:top">{@link Calendar#AM_PM}</th> |
45437 | 77 |
* <td style="vertical-align:top">{@link Calendar#AM} to {@link Calendar#PM}</td> |
14502
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
78 |
* <td>0 - AM, 1 - PM</td> |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
79 |
* </tr> |
45124
144479e89cdb
8179592: Update tables in java.base to be HTML 5-friendly.
jjg
parents:
44844
diff
changeset
|
80 |
* </tbody> |
14502
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
81 |
* </table> |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
82 |
* |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
83 |
* <p style="margin-top:20px">The following are calendar-specific fields and their values to be supported. |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
84 |
* |
45437 | 85 |
* <table class="plain"> |
45124
144479e89cdb
8179592: Update tables in java.base to be HTML 5-friendly.
jjg
parents:
44844
diff
changeset
|
86 |
* <caption style="display:none">Calendar type and field values</caption> |
144479e89cdb
8179592: Update tables in java.base to be HTML 5-friendly.
jjg
parents:
44844
diff
changeset
|
87 |
* <thead> |
14502
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
88 |
* <tr> |
46900
e92e67ed12b4
8186466: Fix accessibility and other minor issues in java.base
jjg
parents:
45437
diff
changeset
|
89 |
* <th scope="col">Calendar Type</th> |
e92e67ed12b4
8186466: Fix accessibility and other minor issues in java.base
jjg
parents:
45437
diff
changeset
|
90 |
* <th scope="col">Field</th> |
e92e67ed12b4
8186466: Fix accessibility and other minor issues in java.base
jjg
parents:
45437
diff
changeset
|
91 |
* <th scope="col">Value</th> |
e92e67ed12b4
8186466: Fix accessibility and other minor issues in java.base
jjg
parents:
45437
diff
changeset
|
92 |
* <th scope="col">Description</th> |
14502
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
93 |
* </tr> |
45124
144479e89cdb
8179592: Update tables in java.base to be HTML 5-friendly.
jjg
parents:
44844
diff
changeset
|
94 |
* </thead> |
144479e89cdb
8179592: Update tables in java.base to be HTML 5-friendly.
jjg
parents:
44844
diff
changeset
|
95 |
* <tbody> |
14502
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
96 |
* <tr> |
46900
e92e67ed12b4
8186466: Fix accessibility and other minor issues in java.base
jjg
parents:
45437
diff
changeset
|
97 |
* <th scope="row"rowspan="2" style="font-weight:normal; text-align:left; vertical-align:top">{@code "gregory"}</th> |
e92e67ed12b4
8186466: Fix accessibility and other minor issues in java.base
jjg
parents:
45437
diff
changeset
|
98 |
* <th scope="row" rowspan="2" style="font-weight:normal; text-align:left; vertical-align:top">{@link Calendar#ERA}</th> |
e92e67ed12b4
8186466: Fix accessibility and other minor issues in java.base
jjg
parents:
45437
diff
changeset
|
99 |
* <th scope="row" style="font-weight:normal">0</th> |
14502
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
100 |
* <td>{@link java.util.GregorianCalendar#BC} (BCE)</td> |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
101 |
* </tr> |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
102 |
* <tr> |
46900
e92e67ed12b4
8186466: Fix accessibility and other minor issues in java.base
jjg
parents:
45437
diff
changeset
|
103 |
* <th scope="row" style="font-weight:normal">1</th> |
14502
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
104 |
* <td>{@link java.util.GregorianCalendar#AD} (CE)</td> |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
105 |
* </tr> |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
106 |
* <tr> |
46900
e92e67ed12b4
8186466: Fix accessibility and other minor issues in java.base
jjg
parents:
45437
diff
changeset
|
107 |
* <th scope="row" rowspan="2" style="font-weight:normal; text-align:left; vertical-align:top">{@code "buddhist"}</th> |
e92e67ed12b4
8186466: Fix accessibility and other minor issues in java.base
jjg
parents:
45437
diff
changeset
|
108 |
* <th scope="row" rowspan="2" style="font-weight:normal; text-align:left; vertical-align:top">{@link Calendar#ERA}</th> |
e92e67ed12b4
8186466: Fix accessibility and other minor issues in java.base
jjg
parents:
45437
diff
changeset
|
109 |
* <th scope="row" style="font-weight:normal">0</th> |
14502
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
110 |
* <td>BC (BCE)</td> |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
111 |
* </tr> |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
112 |
* <tr> |
46900
e92e67ed12b4
8186466: Fix accessibility and other minor issues in java.base
jjg
parents:
45437
diff
changeset
|
113 |
* <th scope="row" style="font-weight:normal">1</th> |
14502
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
114 |
* <td>B.E. (Buddhist Era)</td> |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
115 |
* </tr> |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
116 |
* <tr> |
54360
6a4abdb6749c
8174268: Declare a public field in JapaneseEra for the era starting May 2019
naoto
parents:
47216
diff
changeset
|
117 |
* <th scope="row" rowspan="7" style="font-weight:normal; text-align:left; vertical-align:top">{@code "japanese"}</th> |
6a4abdb6749c
8174268: Declare a public field in JapaneseEra for the era starting May 2019
naoto
parents:
47216
diff
changeset
|
118 |
* <th scope="row" rowspan="6" style="font-weight:normal; text-align:left; vertical-align:top">{@link Calendar#ERA}</th> |
46900
e92e67ed12b4
8186466: Fix accessibility and other minor issues in java.base
jjg
parents:
45437
diff
changeset
|
119 |
* <th scope="row" style="font-weight:normal">0</th> |
14502
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
120 |
* <td>Seireki (Before Meiji)</td> |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
121 |
* </tr> |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
122 |
* <tr> |
46900
e92e67ed12b4
8186466: Fix accessibility and other minor issues in java.base
jjg
parents:
45437
diff
changeset
|
123 |
* <th scope="row" style="font-weight:normal">1</th> |
14502
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
124 |
* <td>Meiji</td> |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
125 |
* </tr> |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
126 |
* <tr> |
46900
e92e67ed12b4
8186466: Fix accessibility and other minor issues in java.base
jjg
parents:
45437
diff
changeset
|
127 |
* <th scope="row" style="font-weight:normal">2</th> |
14502
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
128 |
* <td>Taisho</td> |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
129 |
* </tr> |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
130 |
* <tr> |
46900
e92e67ed12b4
8186466: Fix accessibility and other minor issues in java.base
jjg
parents:
45437
diff
changeset
|
131 |
* <th scope="row" style="font-weight:normal">3</th> |
14502
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
132 |
* <td>Showa</td> |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
133 |
* </tr> |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
134 |
* <tr> |
46900
e92e67ed12b4
8186466: Fix accessibility and other minor issues in java.base
jjg
parents:
45437
diff
changeset
|
135 |
* <th scope="row" style="font-weight:normal">4</th> |
54360
6a4abdb6749c
8174268: Declare a public field in JapaneseEra for the era starting May 2019
naoto
parents:
47216
diff
changeset
|
136 |
* <td>Heisei</td> |
6a4abdb6749c
8174268: Declare a public field in JapaneseEra for the era starting May 2019
naoto
parents:
47216
diff
changeset
|
137 |
* </tr> |
6a4abdb6749c
8174268: Declare a public field in JapaneseEra for the era starting May 2019
naoto
parents:
47216
diff
changeset
|
138 |
* <tr> |
6a4abdb6749c
8174268: Declare a public field in JapaneseEra for the era starting May 2019
naoto
parents:
47216
diff
changeset
|
139 |
* <th scope="row" style="font-weight:normal">5</th> |
6a4abdb6749c
8174268: Declare a public field in JapaneseEra for the era starting May 2019
naoto
parents:
47216
diff
changeset
|
140 |
* <td>Reiwa</td> |
14502
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
141 |
* </tr> |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
142 |
* <tr> |
46900
e92e67ed12b4
8186466: Fix accessibility and other minor issues in java.base
jjg
parents:
45437
diff
changeset
|
143 |
* <th scope="row" style="font-weight:normal; text-align:left; vertical-align:top">{@link Calendar#YEAR}</th> |
e92e67ed12b4
8186466: Fix accessibility and other minor issues in java.base
jjg
parents:
45437
diff
changeset
|
144 |
* <th scope="row" style="font-weight:normal">1</th> |
14502
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
145 |
* <td>the first year in each era. It should be returned when a long |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
146 |
* style ({@link Calendar#LONG_FORMAT} or {@link Calendar#LONG_STANDALONE}) is |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
147 |
* specified. See also the <a href="../../text/SimpleDateFormat.html#year"> |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
148 |
* Year representation in {@code SimpleDateFormat}</a>.</td> |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
149 |
* </tr> |
15281
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
150 |
* <tr> |
46900
e92e67ed12b4
8186466: Fix accessibility and other minor issues in java.base
jjg
parents:
45437
diff
changeset
|
151 |
* <th scope="row" rowspan="2" style="font-weight:normal; text-align:left; vertical-align:top">{@code "roc"}</th> |
e92e67ed12b4
8186466: Fix accessibility and other minor issues in java.base
jjg
parents:
45437
diff
changeset
|
152 |
* <th scope="row" rowspan="2" style="font-weight:normal; text-align:left; vertical-align:top">{@link Calendar#ERA}</th> |
e92e67ed12b4
8186466: Fix accessibility and other minor issues in java.base
jjg
parents:
45437
diff
changeset
|
153 |
* <th scope="row" style="font-weight:normal">0</th> |
15281
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
154 |
* <td>Before R.O.C.</td> |
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
155 |
* </tr> |
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
156 |
* <tr> |
46900
e92e67ed12b4
8186466: Fix accessibility and other minor issues in java.base
jjg
parents:
45437
diff
changeset
|
157 |
* <th scope="row" style="font-weight:normal">1</th> |
15281
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
158 |
* <td>R.O.C.</td> |
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
159 |
* </tr> |
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
160 |
* <tr> |
46900
e92e67ed12b4
8186466: Fix accessibility and other minor issues in java.base
jjg
parents:
45437
diff
changeset
|
161 |
* <th scope="row" rowspan="2" style="font-weight:normal; text-align:left; vertical-align:top">{@code "islamic"}</th> |
e92e67ed12b4
8186466: Fix accessibility and other minor issues in java.base
jjg
parents:
45437
diff
changeset
|
162 |
* <th scope="row" rowspan="2" style="font-weight:normal; text-align:left; vertical-align:top">{@link Calendar#ERA}</th> |
e92e67ed12b4
8186466: Fix accessibility and other minor issues in java.base
jjg
parents:
45437
diff
changeset
|
163 |
* <th scope="row" style="font-weight:normal">0</th> |
15281
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
164 |
* <td>Before AH</td> |
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
165 |
* </tr> |
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
166 |
* <tr> |
46900
e92e67ed12b4
8186466: Fix accessibility and other minor issues in java.base
jjg
parents:
45437
diff
changeset
|
167 |
* <th scope="row" style="font-weight:normal">1</th> |
15281
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
168 |
* <td>Anno Hijrah (AH)</td> |
dd43cb9be0e1
8004489: Add support for Minguo and Hijrah calendars to CalendarNameProvider SPI
okutsu
parents:
14765
diff
changeset
|
169 |
* </tr> |
45124
144479e89cdb
8179592: Update tables in java.base to be HTML 5-friendly.
jjg
parents:
44844
diff
changeset
|
170 |
* </tbody> |
14502
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
171 |
* </table> |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
172 |
* |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
173 |
* <p>Calendar field value names for {@code "gregory"} must be consistent with |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
174 |
* the date-time symbols provided by {@link java.text.spi.DateFormatSymbolsProvider}. |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
175 |
* |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
176 |
* <p>Time zone names are supported by {@link TimeZoneNameProvider}. |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
177 |
* |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
178 |
* @author Masayoshi Okutsu |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
179 |
* @since 1.8 |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
180 |
* @see CalendarDataProvider |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
181 |
* @see Locale#getUnicodeLocaleType(String) |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
182 |
*/ |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
183 |
public abstract class CalendarNameProvider extends LocaleServiceProvider { |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
184 |
/** |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
185 |
* Sole constructor. (For invocation by subclass constructors, typically |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
186 |
* implicit.) |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
187 |
*/ |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
188 |
protected CalendarNameProvider() { |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
189 |
} |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
190 |
|
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
191 |
/** |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
192 |
* Returns the string representation (display name) of the calendar |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
193 |
* <code>field value</code> in the given <code>style</code> and |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
194 |
* <code>locale</code>. If no string representation is |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
195 |
* applicable, <code>null</code> is returned. |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
196 |
* |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
197 |
* <p>{@code field} is a {@code Calendar} field index, such as {@link |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
198 |
* Calendar#MONTH}. The time zone fields, {@link Calendar#ZONE_OFFSET} and |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
199 |
* {@link Calendar#DST_OFFSET}, are <em>not</em> supported by this |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
200 |
* method. {@code null} must be returned if any time zone fields are |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
201 |
* specified. |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
202 |
* |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
203 |
* <p>{@code value} is the numeric representation of the {@code field} value. |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
204 |
* For example, if {@code field} is {@link Calendar#DAY_OF_WEEK}, the valid |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
205 |
* values are {@link Calendar#SUNDAY} to {@link Calendar#SATURDAY} |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
206 |
* (inclusive). |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
207 |
* |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
208 |
* <p>{@code style} gives the style of the string representation. It is one |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
209 |
* of {@link Calendar#SHORT_FORMAT} ({@link Calendar#SHORT SHORT}), |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
210 |
* {@link Calendar#SHORT_STANDALONE}, {@link Calendar#LONG_FORMAT} |
14765
0987999ed367
8000983: Support narrow display names for calendar fields
okutsu
parents:
14502
diff
changeset
|
211 |
* ({@link Calendar#LONG LONG}), {@link Calendar#LONG_STANDALONE}, |
0987999ed367
8000983: Support narrow display names for calendar fields
okutsu
parents:
14502
diff
changeset
|
212 |
* {@link Calendar#NARROW_FORMAT}, or {@link Calendar#NARROW_STANDALONE}. |
14502
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
213 |
* |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
214 |
* <p>For example, the following call will return {@code "Sunday"}. |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
215 |
* <pre> |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
216 |
* getDisplayName("gregory", Calendar.DAY_OF_WEEK, Calendar.SUNDAY, |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
217 |
* Calendar.LONG_STANDALONE, Locale.ENGLISH); |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
218 |
* </pre> |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
219 |
* |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
220 |
* @param calendarType |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
221 |
* the calendar type. (Any calendar type given by {@code locale} |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
222 |
* is ignored.) |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
223 |
* @param field |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
224 |
* the {@code Calendar} field index, |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
225 |
* such as {@link Calendar#DAY_OF_WEEK} |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
226 |
* @param value |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
227 |
* the value of the {@code Calendar field}, |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
228 |
* such as {@link Calendar#MONDAY} |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
229 |
* @param style |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
230 |
* the string representation style: one of {@link |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
231 |
* Calendar#SHORT_FORMAT} ({@link Calendar#SHORT SHORT}), |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
232 |
* {@link Calendar#SHORT_STANDALONE}, {@link |
14765
0987999ed367
8000983: Support narrow display names for calendar fields
okutsu
parents:
14502
diff
changeset
|
233 |
* Calendar#LONG_FORMAT} ({@link Calendar#LONG LONG}), |
0987999ed367
8000983: Support narrow display names for calendar fields
okutsu
parents:
14502
diff
changeset
|
234 |
* {@link Calendar#LONG_STANDALONE}, |
0987999ed367
8000983: Support narrow display names for calendar fields
okutsu
parents:
14502
diff
changeset
|
235 |
* {@link Calendar#NARROW_FORMAT}, |
0987999ed367
8000983: Support narrow display names for calendar fields
okutsu
parents:
14502
diff
changeset
|
236 |
* or {@link Calendar#NARROW_STANDALONE} |
14502
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
237 |
* @param locale |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
238 |
* the desired locale |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
239 |
* @return the string representation of the {@code field value}, or {@code |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
240 |
* null} if the string representation is not applicable or |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
241 |
* the given calendar type is unknown |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
242 |
* @throws IllegalArgumentException |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
243 |
* if {@code field} or {@code style} is invalid |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
244 |
* @throws NullPointerException if {@code locale} is {@code null} |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
245 |
* @see TimeZoneNameProvider |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
246 |
* @see java.util.Calendar#get(int) |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
247 |
* @see java.util.Calendar#getDisplayName(int, int, Locale) |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
248 |
*/ |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
249 |
public abstract String getDisplayName(String calendarType, |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
250 |
int field, int value, |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
251 |
int style, Locale locale); |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
252 |
|
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
253 |
/** |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
254 |
* Returns a {@code Map} containing all string representations (display |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
255 |
* names) of the {@code Calendar} {@code field} in the given {@code style} |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
256 |
* and {@code locale} and their corresponding field values. |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
257 |
* |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
258 |
* <p>{@code field} is a {@code Calendar} field index, such as {@link |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
259 |
* Calendar#MONTH}. The time zone fields, {@link Calendar#ZONE_OFFSET} and |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
260 |
* {@link Calendar#DST_OFFSET}, are <em>not</em> supported by this |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
261 |
* method. {@code null} must be returned if any time zone fields are specified. |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
262 |
* |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
263 |
* <p>{@code style} gives the style of the string representation. It must be |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
264 |
* one of {@link Calendar#ALL_STYLES}, {@link Calendar#SHORT_FORMAT} ({@link |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
265 |
* Calendar#SHORT SHORT}), {@link Calendar#SHORT_STANDALONE}, {@link |
14765
0987999ed367
8000983: Support narrow display names for calendar fields
okutsu
parents:
14502
diff
changeset
|
266 |
* Calendar#LONG_FORMAT} ({@link Calendar#LONG LONG}), {@link |
0987999ed367
8000983: Support narrow display names for calendar fields
okutsu
parents:
14502
diff
changeset
|
267 |
* Calendar#LONG_STANDALONE}, {@link Calendar#NARROW_FORMAT}, or |
0987999ed367
8000983: Support narrow display names for calendar fields
okutsu
parents:
14502
diff
changeset
|
268 |
* {@link Calendar#NARROW_STANDALONE}. Note that narrow names may |
0987999ed367
8000983: Support narrow display names for calendar fields
okutsu
parents:
14502
diff
changeset
|
269 |
* not be unique due to use of single characters, such as "S" for Sunday |
0987999ed367
8000983: Support narrow display names for calendar fields
okutsu
parents:
14502
diff
changeset
|
270 |
* and Saturday, and that no narrow names are included in that case. |
14502
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
271 |
* |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
272 |
* <p>For example, the following call will return a {@code Map} containing |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
273 |
* {@code "January"} to {@link Calendar#JANUARY}, {@code "Jan"} to {@link |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
274 |
* Calendar#JANUARY}, {@code "February"} to {@link Calendar#FEBRUARY}, |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
275 |
* {@code "Feb"} to {@link Calendar#FEBRUARY}, and so on. |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
276 |
* <pre> |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
277 |
* getDisplayNames("gregory", Calendar.MONTH, Calendar.ALL_STYLES, Locale.ENGLISH); |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
278 |
* </pre> |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
279 |
* |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
280 |
* @param calendarType |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
281 |
* the calendar type. (Any calendar type given by {@code locale} |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
282 |
* is ignored.) |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
283 |
* @param field |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
284 |
* the calendar field for which the display names are returned |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
285 |
* @param style |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
286 |
* the style applied to the display names; one of |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
287 |
* {@link Calendar#ALL_STYLES}, {@link Calendar#SHORT_FORMAT} |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
288 |
* ({@link Calendar#SHORT SHORT}), {@link |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
289 |
* Calendar#SHORT_STANDALONE}, {@link Calendar#LONG_FORMAT} |
14765
0987999ed367
8000983: Support narrow display names for calendar fields
okutsu
parents:
14502
diff
changeset
|
290 |
* ({@link Calendar#LONG LONG}), {@link Calendar#LONG_STANDALONE}, |
0987999ed367
8000983: Support narrow display names for calendar fields
okutsu
parents:
14502
diff
changeset
|
291 |
* {@link Calendar#NARROW_FORMAT}, |
0987999ed367
8000983: Support narrow display names for calendar fields
okutsu
parents:
14502
diff
changeset
|
292 |
* or {@link Calendar#NARROW_STANDALONE} |
14502
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
293 |
* @param locale |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
294 |
* the desired locale |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
295 |
* @return a {@code Map} containing all display names of {@code field} in |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
296 |
* {@code style} and {@code locale} and their {@code field} values, |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
297 |
* or {@code null} if no display names are defined for {@code field} |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
298 |
* @throws NullPointerException |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
299 |
* if {@code locale} is {@code null} |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
300 |
* @see Calendar#getDisplayNames(int, int, Locale) |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
301 |
*/ |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
302 |
public abstract Map<String, Integer> getDisplayNames(String calendarType, |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
303 |
int field, int style, |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
304 |
Locale locale); |
d63fed06fed4
8000986: Split java.util.spi.CalendarDataProvider into week parameters and field names portions
okutsu
parents:
diff
changeset
|
305 |
} |