1 /* 2 * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle in the LICENSE file that accompanied this code. 10 * 11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package java.util; 27 28 import java.util.Locale.IsoCountryCode; 29 30 class LocaleISOData { 31 /** 32 * The 2- and 3-letter ISO 639 language codes. 33 */ 34 static final String isoLanguageTable = 35 "aa" + "aar" // Afar 36 + "ab" + "abk" // Abkhazian 37 + "ae" + "ave" // Avestan 38 + "af" + "afr" // Afrikaans 39 + "ak" + "aka" // Akan 40 + "am" + "amh" // Amharic 41 + "an" + "arg" // Aragonese 42 + "ar" + "ara" // Arabic 43 + "as" + "asm" // Assamese 44 + "av" + "ava" // Avaric 45 + "ay" + "aym" // Aymara 46 + "az" + "aze" // Azerbaijani 47 + "ba" + "bak" // Bashkir 48 + "be" + "bel" // Belarusian 49 + "bg" + "bul" // Bulgarian 50 + "bh" + "bih" // Bihari 51 + "bi" + "bis" // Bislama 52 + "bm" + "bam" // Bambara 53 + "bn" + "ben" // Bengali 54 + "bo" + "bod" // Tibetan 55 + "br" + "bre" // Breton 56 + "bs" + "bos" // Bosnian 57 + "ca" + "cat" // Catalan 58 + "ce" + "che" // Chechen 59 + "ch" + "cha" // Chamorro 60 + "co" + "cos" // Corsican 61 + "cr" + "cre" // Cree 62 + "cs" + "ces" // Czech 63 + "cu" + "chu" // Church Slavic 64 + "cv" + "chv" // Chuvash 65 + "cy" + "cym" // Welsh 66 + "da" + "dan" // Danish 67 + "de" + "deu" // German 68 + "dv" + "div" // Divehi 69 + "dz" + "dzo" // Dzongkha 70 + "ee" + "ewe" // Ewe 71 + "el" + "ell" // Greek 72 + "en" + "eng" // English 73 + "eo" + "epo" // Esperanto 74 + "es" + "spa" // Spanish 75 + "et" + "est" // Estonian 76 + "eu" + "eus" // Basque 77 + "fa" + "fas" // Persian 78 + "ff" + "ful" // Fulah 79 + "fi" + "fin" // Finnish 80 + "fj" + "fij" // Fijian 81 + "fo" + "fao" // Faroese 82 + "fr" + "fra" // French 83 + "fy" + "fry" // Frisian 84 + "ga" + "gle" // Irish 85 + "gd" + "gla" // Scottish Gaelic 86 + "gl" + "glg" // Gallegan 87 + "gn" + "grn" // Guarani 88 + "gu" + "guj" // Gujarati 89 + "gv" + "glv" // Manx 90 + "ha" + "hau" // Hausa 91 + "he" + "heb" // Hebrew 92 + "hi" + "hin" // Hindi 93 + "ho" + "hmo" // Hiri Motu 94 + "hr" + "hrv" // Croatian 95 + "ht" + "hat" // Haitian 96 + "hu" + "hun" // Hungarian 97 + "hy" + "hye" // Armenian 98 + "hz" + "her" // Herero 99 + "ia" + "ina" // Interlingua 100 + "id" + "ind" // Indonesian 101 + "ie" + "ile" // Interlingue 102 + "ig" + "ibo" // Igbo 103 + "ii" + "iii" // Sichuan Yi 104 + "ik" + "ipk" // Inupiaq 105 + "in" + "ind" // Indonesian (old) 106 + "io" + "ido" // Ido 107 + "is" + "isl" // Icelandic 108 + "it" + "ita" // Italian 109 + "iu" + "iku" // Inuktitut 110 + "iw" + "heb" // Hebrew (old) 111 + "ja" + "jpn" // Japanese 112 + "ji" + "yid" // Yiddish (old) 113 + "jv" + "jav" // Javanese 114 + "ka" + "kat" // Georgian 115 + "kg" + "kon" // Kongo 116 + "ki" + "kik" // Kikuyu 117 + "kj" + "kua" // Kwanyama 118 + "kk" + "kaz" // Kazakh 119 + "kl" + "kal" // Greenlandic 120 + "km" + "khm" // Khmer 121 + "kn" + "kan" // Kannada 122 + "ko" + "kor" // Korean 123 + "kr" + "kau" // Kanuri 124 + "ks" + "kas" // Kashmiri 125 + "ku" + "kur" // Kurdish 126 + "kv" + "kom" // Komi 127 + "kw" + "cor" // Cornish 128 + "ky" + "kir" // Kirghiz 129 + "la" + "lat" // Latin 130 + "lb" + "ltz" // Luxembourgish 131 + "lg" + "lug" // Ganda 132 + "li" + "lim" // Limburgish 133 + "ln" + "lin" // Lingala 134 + "lo" + "lao" // Lao 135 + "lt" + "lit" // Lithuanian 136 + "lu" + "lub" // Luba-Katanga 137 + "lv" + "lav" // Latvian 138 + "mg" + "mlg" // Malagasy 139 + "mh" + "mah" // Marshallese 140 + "mi" + "mri" // Maori 141 + "mk" + "mkd" // Macedonian 142 + "ml" + "mal" // Malayalam 143 + "mn" + "mon" // Mongolian 144 + "mo" + "mol" // Moldavian 145 + "mr" + "mar" // Marathi 146 + "ms" + "msa" // Malay 147 + "mt" + "mlt" // Maltese 148 + "my" + "mya" // Burmese 149 + "na" + "nau" // Nauru 150 + "nb" + "nob" // Norwegian Bokm?l 151 + "nd" + "nde" // North Ndebele 152 + "ne" + "nep" // Nepali 153 + "ng" + "ndo" // Ndonga 154 + "nl" + "nld" // Dutch 155 + "nn" + "nno" // Norwegian Nynorsk 156 + "no" + "nor" // Norwegian 157 + "nr" + "nbl" // South Ndebele 158 + "nv" + "nav" // Navajo 159 + "ny" + "nya" // Nyanja 160 + "oc" + "oci" // Occitan 161 + "oj" + "oji" // Ojibwa 162 + "om" + "orm" // Oromo 163 + "or" + "ori" // Oriya 164 + "os" + "oss" // Ossetian 165 + "pa" + "pan" // Panjabi 166 + "pi" + "pli" // Pali 167 + "pl" + "pol" // Polish 168 + "ps" + "pus" // Pushto 169 + "pt" + "por" // Portuguese 170 + "qu" + "que" // Quechua 171 + "rm" + "roh" // Raeto-Romance 172 + "rn" + "run" // Rundi 173 + "ro" + "ron" // Romanian 174 + "ru" + "rus" // Russian 175 + "rw" + "kin" // Kinyarwanda 176 + "sa" + "san" // Sanskrit 177 + "sc" + "srd" // Sardinian 178 + "sd" + "snd" // Sindhi 179 + "se" + "sme" // Northern Sami 180 + "sg" + "sag" // Sango 181 + "si" + "sin" // Sinhalese 182 + "sk" + "slk" // Slovak 183 + "sl" + "slv" // Slovenian 184 + "sm" + "smo" // Samoan 185 + "sn" + "sna" // Shona 186 + "so" + "som" // Somali 187 + "sq" + "sqi" // Albanian 188 + "sr" + "srp" // Serbian 189 + "ss" + "ssw" // Swati 190 + "st" + "sot" // Southern Sotho 191 + "su" + "sun" // Sundanese 192 + "sv" + "swe" // Swedish 193 + "sw" + "swa" // Swahili 194 + "ta" + "tam" // Tamil 195 + "te" + "tel" // Telugu 196 + "tg" + "tgk" // Tajik 197 + "th" + "tha" // Thai 198 + "ti" + "tir" // Tigrinya 199 + "tk" + "tuk" // Turkmen 200 + "tl" + "tgl" // Tagalog 201 + "tn" + "tsn" // Tswana 202 + "to" + "ton" // Tonga 203 + "tr" + "tur" // Turkish 204 + "ts" + "tso" // Tsonga 205 + "tt" + "tat" // Tatar 206 + "tw" + "twi" // Twi 207 + "ty" + "tah" // Tahitian 208 + "ug" + "uig" // Uighur 209 + "uk" + "ukr" // Ukrainian 210 + "ur" + "urd" // Urdu 211 + "uz" + "uzb" // Uzbek 212 + "ve" + "ven" // Venda 213 + "vi" + "vie" // Vietnamese 214 + "vo" + "vol" // Volap?k 215 + "wa" + "wln" // Walloon 216 + "wo" + "wol" // Wolof 217 + "xh" + "xho" // Xhosa 218 + "yi" + "yid" // Yiddish 219 + "yo" + "yor" // Yoruba 220 + "za" + "zha" // Zhuang 221 + "zh" + "zho" // Chinese 222 + "zu" + "zul" // Zulu 223 ; 224 225 /** 226 * The 2- and 3-letter ISO 3166 country codes. 227 */ 228 static final String isoCountryTable = 229 "AD" + "AND" // Andorra, Principality of 230 + "AE" + "ARE" // United Arab Emirates 231 + "AF" + "AFG" // Afghanistan 232 + "AG" + "ATG" // Antigua and Barbuda 233 + "AI" + "AIA" // Anguilla 234 + "AL" + "ALB" // Albania, People's Socialist Republic of 235 + "AM" + "ARM" // Armenia 236 // + "AN" + "ANT" // Netherlands Antilles 237 + "AO" + "AGO" // Angola, Republic of 238 + "AQ" + "ATA" // Antarctica (the territory South of 60 deg S) 239 + "AR" + "ARG" // Argentina, Argentine Republic 240 + "AS" + "ASM" // American Samoa 241 + "AT" + "AUT" // Austria, Republic of 242 + "AU" + "AUS" // Australia, Commonwealth of 243 + "AW" + "ABW" // Aruba 244 + "AX" + "ALA" // \u00c5land Islands 245 + "AZ" + "AZE" // Azerbaijan, Republic of 246 + "BA" + "BIH" // Bosnia and Herzegovina 247 + "BB" + "BRB" // Barbados 248 + "BD" + "BGD" // Bangladesh, People's Republic of 249 + "BE" + "BEL" // Belgium, Kingdom of 250 + "BF" + "BFA" // Burkina Faso 251 + "BG" + "BGR" // Bulgaria, People's Republic of 252 + "BH" + "BHR" // Bahrain, Kingdom of 253 + "BI" + "BDI" // Burundi, Republic of 254 + "BJ" + "BEN" // Benin, People's Republic of 255 + "BL" + "BLM" // Saint Barth\u00e9lemy 256 + "BM" + "BMU" // Bermuda 257 + "BN" + "BRN" // Brunei Darussalam 258 + "BO" + "BOL" // Bolivia, Republic of 259 + "BQ" + "BES" // Bonaire, Sint Eustatius and Saba 260 + "BR" + "BRA" // Brazil, Federative Republic of 261 + "BS" + "BHS" // Bahamas, Commonwealth of the 262 + "BT" + "BTN" // Bhutan, Kingdom of 263 + "BV" + "BVT" // Bouvet Island (Bouvetoya) 264 + "BW" + "BWA" // Botswana, Republic of 265 + "BY" + "BLR" // Belarus 266 + "BZ" + "BLZ" // Belize 267 + "CA" + "CAN" // Canada 268 + "CC" + "CCK" // Cocos (Keeling) Islands 269 + "CD" + "COD" // Congo, Democratic Republic of 270 + "CF" + "CAF" // Central African Republic 271 + "CG" + "COG" // Congo, People's Republic of 272 + "CH" + "CHE" // Switzerland, Swiss Confederation 273 + "CI" + "CIV" // Cote D'Ivoire, Ivory Coast, Republic of the 274 + "CK" + "COK" // Cook Islands 275 + "CL" + "CHL" // Chile, Republic of 276 + "CM" + "CMR" // Cameroon, United Republic of 277 + "CN" + "CHN" // China, People's Republic of 278 + "CO" + "COL" // Colombia, Republic of 279 + "CR" + "CRI" // Costa Rica, Republic of 280 // + "CS" + "SCG" // Serbia and Montenegro 281 + "CU" + "CUB" // Cuba, Republic of 282 + "CV" + "CPV" // Cape Verde, Republic of 283 + "CW" + "CUW" // Cura\u00e7ao 284 + "CX" + "CXR" // Christmas Island 285 + "CY" + "CYP" // Cyprus, Republic of 286 + "CZ" + "CZE" // Czech Republic 287 + "DE" + "DEU" // Germany 288 + "DJ" + "DJI" // Djibouti, Republic of 289 + "DK" + "DNK" // Denmark, Kingdom of 290 + "DM" + "DMA" // Dominica, Commonwealth of 291 + "DO" + "DOM" // Dominican Republic 292 + "DZ" + "DZA" // Algeria, People's Democratic Republic of 293 + "EC" + "ECU" // Ecuador, Republic of 294 + "EE" + "EST" // Estonia 295 + "EG" + "EGY" // Egypt, Arab Republic of 296 + "EH" + "ESH" // Western Sahara 297 + "ER" + "ERI" // Eritrea 298 + "ES" + "ESP" // Spain, Spanish State 299 + "ET" + "ETH" // Ethiopia 300 + "FI" + "FIN" // Finland, Republic of 301 + "FJ" + "FJI" // Fiji, Republic of the Fiji Islands 302 + "FK" + "FLK" // Falkland Islands (Malvinas) 303 + "FM" + "FSM" // Micronesia, Federated States of 304 + "FO" + "FRO" // Faeroe Islands 305 + "FR" + "FRA" // France, French Republic 306 + "GA" + "GAB" // Gabon, Gabonese Republic 307 + "GB" + "GBR" // United Kingdom of Great Britain & N. Ireland 308 + "GD" + "GRD" // Grenada 309 + "GE" + "GEO" // Georgia 310 + "GF" + "GUF" // French Guiana 311 + "GG" + "GGY" // Guernsey 312 + "GH" + "GHA" // Ghana, Republic of 313 + "GI" + "GIB" // Gibraltar 314 + "GL" + "GRL" // Greenland 315 + "GM" + "GMB" // Gambia, Republic of the 316 + "GN" + "GIN" // Guinea, Revolutionary People's Rep'c of 317 + "GP" + "GLP" // Guadaloupe 318 + "GQ" + "GNQ" // Equatorial Guinea, Republic of 319 + "GR" + "GRC" // Greece, Hellenic Republic 320 + "GS" + "SGS" // South Georgia and the South Sandwich Islands 321 + "GT" + "GTM" // Guatemala, Republic of 322 + "GU" + "GUM" // Guam 323 + "GW" + "GNB" // Guinea-Bissau, Republic of 324 + "GY" + "GUY" // Guyana, Republic of 325 + "HK" + "HKG" // Hong Kong, Special Administrative Region of China 326 + "HM" + "HMD" // Heard and McDonald Islands 327 + "HN" + "HND" // Honduras, Republic of 328 + "HR" + "HRV" // Hrvatska (Croatia) 329 + "HT" + "HTI" // Haiti, Republic of 330 + "HU" + "HUN" // Hungary, Hungarian People's Republic 331 + "ID" + "IDN" // Indonesia, Republic of 332 + "IE" + "IRL" // Ireland 333 + "IL" + "ISR" // Israel, State of 334 + "IM" + "IMN" // Isle of Man 335 + "IN" + "IND" // India, Republic of 336 + "IO" + "IOT" // British Indian Ocean Territory (Chagos Archipelago) 337 + "IQ" + "IRQ" // Iraq, Republic of 338 + "IR" + "IRN" // Iran, Islamic Republic of 339 + "IS" + "ISL" // Iceland, Republic of 340 + "IT" + "ITA" // Italy, Italian Republic 341 + "JE" + "JEY" // Jersey 342 + "JM" + "JAM" // Jamaica 343 + "JO" + "JOR" // Jordan, Hashemite Kingdom of 344 + "JP" + "JPN" // Japan 345 + "KE" + "KEN" // Kenya, Republic of 346 + "KG" + "KGZ" // Kyrgyz Republic 347 + "KH" + "KHM" // Cambodia, Kingdom of 348 + "KI" + "KIR" // Kiribati, Republic of 349 + "KM" + "COM" // Comoros, Union of the 350 + "KN" + "KNA" // St. Kitts and Nevis 351 + "KP" + "PRK" // Korea, Democratic People's Republic of 352 + "KR" + "KOR" // Korea, Republic of 353 + "KW" + "KWT" // Kuwait, State of 354 + "KY" + "CYM" // Cayman Islands 355 + "KZ" + "KAZ" // Kazakhstan, Republic of 356 + "LA" + "LAO" // Lao People's Democratic Republic 357 + "LB" + "LBN" // Lebanon, Lebanese Republic 358 + "LC" + "LCA" // St. Lucia 359 + "LI" + "LIE" // Liechtenstein, Principality of 360 + "LK" + "LKA" // Sri Lanka, Democratic Socialist Republic of 361 + "LR" + "LBR" // Liberia, Republic of 362 + "LS" + "LSO" // Lesotho, Kingdom of 363 + "LT" + "LTU" // Lithuania 364 + "LU" + "LUX" // Luxembourg, Grand Duchy of 365 + "LV" + "LVA" // Latvia 366 + "LY" + "LBY" // Libyan Arab Jamahiriya 367 + "MA" + "MAR" // Morocco, Kingdom of 368 + "MC" + "MCO" // Monaco, Principality of 369 + "MD" + "MDA" // Moldova, Republic of 370 + "ME" + "MNE" // Montenegro, Republic of 371 + "MF" + "MAF" // Saint Martin 372 + "MG" + "MDG" // Madagascar, Republic of 373 + "MH" + "MHL" // Marshall Islands 374 + "MK" + "MKD" // Macedonia, the former Yugoslav Republic of 375 + "ML" + "MLI" // Mali, Republic of 376 + "MM" + "MMR" // Myanmar 377 + "MN" + "MNG" // Mongolia, Mongolian People's Republic 378 + "MO" + "MAC" // Macao, Special Administrative Region of China 379 + "MP" + "MNP" // Northern Mariana Islands 380 + "MQ" + "MTQ" // Martinique 381 + "MR" + "MRT" // Mauritania, Islamic Republic of 382 + "MS" + "MSR" // Montserrat 383 + "MT" + "MLT" // Malta, Republic of 384 + "MU" + "MUS" // Mauritius 385 + "MV" + "MDV" // Maldives, Republic of 386 + "MW" + "MWI" // Malawi, Republic of 387 + "MX" + "MEX" // Mexico, United Mexican States 388 + "MY" + "MYS" // Malaysia 389 + "MZ" + "MOZ" // Mozambique, People's Republic of 390 + "NA" + "NAM" // Namibia 391 + "NC" + "NCL" // New Caledonia 392 + "NE" + "NER" // Niger, Republic of the 393 + "NF" + "NFK" // Norfolk Island 394 + "NG" + "NGA" // Nigeria, Federal Republic of 395 + "NI" + "NIC" // Nicaragua, Republic of 396 + "NL" + "NLD" // Netherlands, Kingdom of the 397 + "NO" + "NOR" // Norway, Kingdom of 398 + "NP" + "NPL" // Nepal, Kingdom of 399 + "NR" + "NRU" // Nauru, Republic of 400 + "NU" + "NIU" // Niue, Republic of 401 + "NZ" + "NZL" // New Zealand 402 + "OM" + "OMN" // Oman, Sultanate of 403 + "PA" + "PAN" // Panama, Republic of 404 + "PE" + "PER" // Peru, Republic of 405 + "PF" + "PYF" // French Polynesia 406 + "PG" + "PNG" // Papua New Guinea 407 + "PH" + "PHL" // Philippines, Republic of the 408 + "PK" + "PAK" // Pakistan, Islamic Republic of 409 + "PL" + "POL" // Poland, Republic of Poland 410 + "PM" + "SPM" // St. Pierre and Miquelon 411 + "PN" + "PCN" // Pitcairn Island 412 + "PR" + "PRI" // Puerto Rico 413 + "PS" + "PSE" // Palestinian Territory, Occupied 414 + "PT" + "PRT" // Portugal, Portuguese Republic 415 + "PW" + "PLW" // Palau 416 + "PY" + "PRY" // Paraguay, Republic of 417 + "QA" + "QAT" // Qatar, State of 418 + "RE" + "REU" // Reunion 419 + "RO" + "ROU" // Romania, Socialist Republic of 420 + "RS" + "SRB" // Serbia, Republic of 421 + "RU" + "RUS" // Russian Federation 422 + "RW" + "RWA" // Rwanda, Rwandese Republic 423 + "SA" + "SAU" // Saudi Arabia, Kingdom of 424 + "SB" + "SLB" // Solomon Islands 425 + "SC" + "SYC" // Seychelles, Republic of 426 + "SD" + "SDN" // Sudan, Democratic Republic of the 427 + "SE" + "SWE" // Sweden, Kingdom of 428 + "SG" + "SGP" // Singapore, Republic of 429 + "SH" + "SHN" // St. Helena 430 + "SI" + "SVN" // Slovenia 431 + "SJ" + "SJM" // Svalbard & Jan Mayen Islands 432 + "SK" + "SVK" // Slovakia (Slovak Republic) 433 + "SL" + "SLE" // Sierra Leone, Republic of 434 + "SM" + "SMR" // San Marino, Republic of 435 + "SN" + "SEN" // Senegal, Republic of 436 + "SO" + "SOM" // Somalia, Somali Republic 437 + "SR" + "SUR" // Suriname, Republic of 438 + "SS" + "SSD" // South Sudan 439 + "ST" + "STP" // Sao Tome and Principe, Democratic Republic of 440 + "SV" + "SLV" // El Salvador, Republic of 441 + "SX" + "SXM" // Sint Maarten (Dutch part) 442 + "SY" + "SYR" // Syrian Arab Republic 443 + "SZ" + "SWZ" // Swaziland, Kingdom of 444 + "TC" + "TCA" // Turks and Caicos Islands 445 + "TD" + "TCD" // Chad, Republic of 446 + "TF" + "ATF" // French Southern Territories 447 + "TG" + "TGO" // Togo, Togolese Republic 448 + "TH" + "THA" // Thailand, Kingdom of 449 + "TJ" + "TJK" // Tajikistan 450 + "TK" + "TKL" // Tokelau (Tokelau Islands) 451 + "TL" + "TLS" // Timor-Leste, Democratic Republic of 452 + "TM" + "TKM" // Turkmenistan 453 + "TN" + "TUN" // Tunisia, Republic of 454 + "TO" + "TON" // Tonga, Kingdom of 455 + "TR" + "TUR" // Turkey, Republic of 456 + "TT" + "TTO" // Trinidad and Tobago, Republic of 457 + "TV" + "TUV" // Tuvalu 458 + "TW" + "TWN" // Taiwan, Province of China 459 + "TZ" + "TZA" // Tanzania, United Republic of 460 + "UA" + "UKR" // Ukraine 461 + "UG" + "UGA" // Uganda, Republic of 462 + "UM" + "UMI" // United States Minor Outlying Islands 463 + "US" + "USA" // United States of America 464 + "UY" + "URY" // Uruguay, Eastern Republic of 465 + "UZ" + "UZB" // Uzbekistan 466 + "VA" + "VAT" // Holy See (Vatican City State) 467 + "VC" + "VCT" // St. Vincent and the Grenadines 468 + "VE" + "VEN" // Venezuela, Bolivarian Republic of 469 + "VG" + "VGB" // British Virgin Islands 470 + "VI" + "VIR" // US Virgin Islands 471 + "VN" + "VNM" // Viet Nam, Socialist Republic of 472 + "VU" + "VUT" // Vanuatu 473 + "WF" + "WLF" // Wallis and Futuna Islands 474 + "WS" + "WSM" // Samoa, Independent State of 475 + "YE" + "YEM" // Yemen 476 + "YT" + "MYT" // Mayotte 477 + "ZA" + "ZAF" // South Africa, Republic of 478 + "ZM" + "ZMB" // Zambia, Republic of 479 + "ZW" + "ZWE" // Zimbabwe 480 ; 481 482 /** 483 * Array to hold country codes for ISO3166-3. 484 */ 485 private static final String[] ISO3166_3 = { 486 "AIDJ", "ANHH", "BQAQ", "BUMM", "BYAA", "CSHH", "CSXX", "CTKI", "DDDE", 487 "DYBJ", "FQHH", "FXFR", "GEHH", "HVBF", "JTUM", "MIUM", "NHVU", "NQAQ", 488 "NTHH", "PCHH", "PUUM", "PZPA", "RHZW", "SKIN", "SUHH", "TPTL", "VDVN", 489 "WKUM", "YDYE", "YUCS", "ZRCD" 490 }; 491 492 /** 493 * Map to hold country codes for each ISO3166 part. 494 */ 495 private static Map<IsoCountryCode, Set<String>> iso3166CodesMap = new HashMap<>(); 496 497 /** 498 * This mapping function attempts to compute value for iso3166CodesMap 499 * for each IsoCountryCode type key. 500 */ 501 private static Set<String> getISOCountriesImpl(IsoCountryCode type) { 502 switch (type) { 503 case PART1_ALPHA2: 504 return Set.of(Locale.getISOCountries()); 505 case PART1_ALPHA3: 506 return LocaleISOData.computeISO3166_1Alpha3Countries(); 507 case PART3: 508 return Set.of(ISO3166_3); 509 default: 510 // should not happen 511 assert false; 512 return Collections.emptySet(); 513 } 514 } 515 516 /** 517 * This method is called from Locale class 518 * to retrieve country code set for getISOCountries(type) 519 */ 520 static Set<String> retrieveIsoCountryCodes(IsoCountryCode type) { 521 return iso3166CodesMap.computeIfAbsent(type, LocaleISOData::getISOCountriesImpl); 522 } 523 524 /** 525 * This method computes a set of ISO3166-1 alpha-3 country codes from 526 * existing isoCountryTable. 527 */ 528 private static Set<String> computeISO3166_1Alpha3Countries() { 529 int tableLength = isoCountryTable.length(); 530 String[] isoTable = new String[tableLength / 5]; 531 for (int i = 0, index = 0; index < tableLength; i++, index += 5) { 532 isoTable[i] = isoCountryTable.substring(index + 2, index + 5); 533 } 534 return Set.of(isoTable); 535 } 536 537 private LocaleISOData() { 538 } 539 }