2
2
3
3
import java .util .Locale ;
4
4
5
+ /**
6
+ * There are different types of name. This enum enumerates some of those types.
7
+ *
8
+ * <p>For example, "Sanskrit", "Devanagari", and "India" are names of a language, a script, and a
9
+ * territory, respectively. A generic method that works for languages, scripts, territories, etc.,
10
+ * may be called to get one of those names (or their equivalents for a locale other than English)
11
+ * with a NameType parameter set to NameType.LANGUAGE, NameType.SCRIPT, or NameType.TERRITORY,
12
+ * respectively, to indicate what type of name is requested (possibly with additional parameters
13
+ * like a code such as "sa" for "Sanskrit"). The values starting with TZ_ are for time zones.
14
+ */
5
15
public enum NameType {
6
16
NONE ,
7
17
LANGUAGE ,
@@ -21,9 +31,15 @@ public enum NameType {
21
31
KEY_TYPE ,
22
32
SUBDIVISION ;
23
33
24
- // The order of rows must correspond to INDEX_LANGUAGE, INDEX_SCRIPT, etc.
25
- // Caution: the presence of "key|type" presents complications for refactoring.
26
- // The row with "key|type" has four strings, while the others have three.
34
+ /**
35
+ * This data in NameTable is used for associating types of path with types of name. For legacy
36
+ * reasons it still contains strings like "language" rather than the corresponding enum values
37
+ * like NameType.LANGUAGE.
38
+ *
39
+ * <p>The order of rows must correspond to INDEX_LANGUAGE, INDEX_SCRIPT, etc. Caution: the
40
+ * presence of "key|type" presents complications for refactoring. The row with "key|type" has
41
+ * four strings, while the others have three.
42
+ */
27
43
private static final String [][] NameTable = {
28
44
{"//ldml/localeDisplayNames/languages/language[@type=\" " , "\" ]" , "language" },
29
45
{"//ldml/localeDisplayNames/scripts/script[@type=\" " , "\" ]" , "script" },
0 commit comments