java.util.Locale (JDK 1.1)
The Locale class represents a locale: a political, geographical, or cultural region that typically has a distinct language and distinct customs and conventions for such things as formatting dates, times, and numbers.
The Locale class defines a number of constants that represent commonly used locales. Locale also defines a static getDefault() method that returns the default Locale object, which represents a locale value inherited from the host system. Furthermore, many locale-sensitive classes, such as DateFormat, provide getAvailableLocales() methods that return a list of supported Locale objects. If none of these methods for obtaining a Locale object is suitable, you can also explicitly create your own Locale object. To do this, you must specify a language code, a country code, and an optional variant string.
The Locale class does not implement any internationalization behavior itself; it merely serves as a locale identifier for those classes that can localize their behavior. Given a Locale object, you can invoke the various getDisplay methods to obtain a description of the locale suitable for display to a user. Note that these methods may themselves take a Locale argument so that the names of languages and countries can be localized as appropriate.
public final classLocaleextends Object implements Cloneable, Serializable { //Public ConstructorspublicLocale(Stringlanguage, Stringcountry, Stringvariant); publicLocale(Stringlanguage, Stringcountry); //Constantspublic static final LocaleCANADA; public static final LocaleCANADA_FRENCH; public static final LocaleCHINA; public static final LocaleCHINESE; public static final LocaleENGLISH; public static final LocaleFRANCE; public static final LocaleFRENCH; public static final LocaleGERMAN; public static final LocaleGERMANY; public static final LocaleITALIAN; public static final LocaleITALY; public static final LocaleJAPAN; public static final LocaleJAPANESE; public static final LocaleKOREA; public static final LocaleKOREAN; public static final LocalePRC; public static final LocaleSIMPLIFIED_CHINESE; public static final LocaleTAIWAN; public static final LocaleTRADITIONAL_CHINESE; public static final LocaleUK; public static final LocaleUS; //Class Methodspublic static synchronized LocalegetDefault(); public static synchronized voidsetDefault(LocalenewLocale); //Public Instance Methodspublic Objectclone(); //Overrides Objectpublic booleanequals(Objectobj); //Overrides Objectpublic StringgetCountry(); public final StringgetDisplayCountry(); public StringgetDisplayCountry(LocaleinLocale); public final StringgetDisplayLanguage(); public StringgetDisplayLanguage(LocaleinLocale); public final StringgetDisplayName(); public StringgetDisplayName(LocaleinLocale); public final StringgetDisplayVariant(); public StringgetDisplayVariant(LocaleinLocale); public StringgetISO3Country() throws MissingResourceException; public StringgetISO3Language() throws MissingResourceException; public StringgetLanguage(); public StringgetVariant(); public synchronized inthashCode(); //Overrides Objectpublic final StringtoString(); //Overrides Object}
Passed To:
BreakIterator.getCharacterInstance(), BreakIterator.getLineInstance(), BreakIterator.getSentenceInstance(), BreakIterator.getWordInstance(), Calendar(), Calendar.getInstance(), Collator.getInstance(), Component.setLocale(), DateFormat.getDateInstance(), DateFormat.getDateTimeInstance(), DateFormat.getTimeInstance(), DateFormatSymbols(), DecimalFormatSymbols(), GregorianCalendar(), Locale.getDisplayCountry(), Locale.getDisplayLanguage(), Locale.getDisplayName(), Locale.getDisplayVariant(), Locale.setDefault(), MessageFormat.setLocale(), NumberFormat.getCurrencyInstance(), NumberFormat.getInstance(), NumberFormat.getNumberInstance(), NumberFormat.getPercentInstance(), ResourceBundle.getBundle(), SimpleDateFormat(), String.toLowerCase(), String.toUpperCase()
Returned By:
Applet.getLocale(), BreakIterator.getAvailableLocales(), Calendar.getAvailableLocales(), Collator.getAvailableLocales(), Component.getLocale(), DateFormat.getAvailableLocales(), Locale.getDefault(), MessageFormat.getLocale(), NumberFormat.getAvailableLocales(), Window.getLocale()