Top Description Fields Constructors Methods
com.ibm.icu.impl

public Class LocaleIDs

extends Object
Class Inheritance
Imports
java.util.MissingResourceException

Utilities for mapping between old and new language, country, and other locale ID related names.

Field Summary

Modifier and TypeField and Description
private static final String[]
private static final String[]
private static final String[]
private static final String[]
_languages

Tables used in normalizing portions of the id.

private static final String[]
private static final String[]
private static final String[]
private static final String[]
private static final String[]
private static final String[]
private static final String[]

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static int
findIndex(String[] array, String target)

linear search of the string array.

public static String
public static String
public static String
getISO3Country(String country)

Returns a three-letter abbreviation for the provided country.

public static String
getISO3Language(String language)

Returns a three-letter abbreviation for the language.

public static String[]
getISOCountries()

Returns a list of all 2-letter country codes defined in ISO 3166.

public static String[]
getISOLanguages()

Returns a list of all 2-letter language codes defined in ISO 639 plus additional 3-letter codes determined to be useful for locale generation as defined by Unicode CLDR.

public static String
public static String
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_countriesback to summary
private static final String[] _countries
_countries3back to summary
private static final String[] _countries3
_deprecatedCountriesback to summary
private static final String[] _deprecatedCountries
_languagesback to summary
private static final String[] _languages

Tables used in normalizing portions of the id.

_languages3back to summary
private static final String[] _languages3
_obsoleteCountriesback to summary
private static final String[] _obsoleteCountries
_obsoleteCountries3back to summary
private static final String[] _obsoleteCountries3
_obsoleteLanguagesback to summary
private static final String[] _obsoleteLanguages
_obsoleteLanguages3back to summary
private static final String[] _obsoleteLanguages3
_replacementCountriesback to summary
private static final String[] _replacementCountries
_replacementLanguagesback to summary
private static final String[] _replacementLanguages

Constructor Detail

LocaleIDsback to summary
public LocaleIDs()

Method Detail

findIndexback to summary
private static int findIndex(String[] array, String target)

linear search of the string array. the arrays are unfortunately ordered by the two-letter target code, not the three-letter search code, which seems backwards.

getCurrentCountryIDback to summary
public static String getCurrentCountryID(String oldID)
getCurrentLanguageIDback to summary
public static String getCurrentLanguageID(String oldID)
getISO3Countryback to summary
public static String getISO3Country(String country)

Returns a three-letter abbreviation for the provided country. If the provided country is empty, returns the empty string. Otherwise, returns an uppercase ISO 3166 3-letter country code.

Exceptions
MissingResourceException:
Throws MissingResourceException if the three-letter country abbreviation is not available for this locale.
ICU Status
Stable since ICU 3.0.
getISO3Languageback to summary
public static String getISO3Language(String language)

Returns a three-letter abbreviation for the language. If language is empty, returns the empty string. Otherwise, returns a lowercase ISO 639-2/T language code. The ISO 639-2 language codes can be found on-line at ftp://dkuug.dk/i18n/iso-639-2.txt

Exceptions
MissingResourceException:
Throws MissingResourceException if the three-letter language abbreviation is not available for this locale.
ICU Status
Stable since ICU 3.0.
getISOCountriesback to summary
public static String[] getISOCountries()

Returns a list of all 2-letter country codes defined in ISO 3166. Can be used to create Locales.

ICU Status
Stable since ICU 3.0.
getISOLanguagesback to summary
public static String[] getISOLanguages()

Returns a list of all 2-letter language codes defined in ISO 639 plus additional 3-letter codes determined to be useful for locale generation as defined by Unicode CLDR. Can be used to create Locales. [NOTE: ISO 639 is not a stable standard-- some languages' codes have changed. The list this function returns includes both the new and the old codes for the languages whose codes have changed.]

ICU Status
Stable since ICU 3.0.
threeToTwoLetterLanguageback to summary
public static String threeToTwoLetterLanguage(String lang)
threeToTwoLetterRegionback to summary
public static String threeToTwoLetterRegion(String region)