API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.util. Locale View Source
Author(s)
Mark Davis
Since
1.1
Version
Serial
Hierarchy
 Object
      Locale
Implements
 Cloneable
 Serializable
Subclasses
Description
publicfinal class Locale
  A Locale object represents a specific geographical, political, or cultural region.
Constructors
public Locale (String language)
  Construct a locale from a language code.
public Locale (String language, String country)
  Construct a locale from language, country.
private Locale (String language, String country, boolean flag)
  Constructs a Locale using language and country.
public Locale (String language, String country, String variant)
  Construct a locale from language, country, variant.
Methods
Hide/Show inherited methods
public Object clone ()
Overrides Cloneable
public boolean equals (Object obj)
  Returns true if this Locale is equal to another object.
publicstatic Locale getAvailableLocales ()
  Returns an array of all installed locales.
public String getCountry ()
  Returns the country/region code for this locale, which will either be the empty string or an uppercase ISO 3166 2-letter code.
publicstatic Locale getDefault ()
  Gets the current value of the default locale for this instance of the Java Virtual Machine.
publicfinal String getDisplayCountry ()
  Returns a name for the locale's country that is appropriate for display to the user.
public String getDisplayCountry (Locale inLocale)
  Returns a name for the locale's country that is appropriate for display to the user.
publicfinal String getDisplayLanguage ()
  Returns a name for the locale's language that is appropriate for display to the user.
public String getDisplayLanguage (Locale inLocale)
  Returns a name for the locale's language that is appropriate for display to the user.
publicfinal String getDisplayName ()
  Returns a name for the locale that is appropriate for display to the user.
public String getDisplayName (Locale inLocale)
  Returns a name for the locale that is appropriate for display to the user.
publicfinal String getDisplayVariant ()
  Returns a name for the locale's variant code that is appropriate for display to the user.
public String getDisplayVariant (Locale inLocale)
  Returns a name for the locale's variant code that is appropriate for display to the user.
pack-privatestatic Locale getInstance (String language, String country, String variant)
  Returns a Locale constructed from the given language, country and variant.
public String getISO3Country () throws MissingResourceException
  Returns a three-letter abbreviation for this locale's country.
public String getISO3Language () throws MissingResourceException
  Returns a three-letter abbreviation for this locale's language.
publicstatic String getISOCountries ()
  Returns a list of all 2-letter country codes defined in ISO 3166.
publicstatic String getISOLanguages ()
  Returns a list of all 2-letter language codes defined in ISO 639.
public String getLanguage ()
  Returns the language code for this locale, which will either be the empty string or a lowercase ISO 639 code.
public String getVariant ()
  Returns the variant code for this locale.
public int hashCode ()
  Override hashCode.
publicstaticsynchronized void setDefault (Locale newLocale)
  Sets the default locale for this instance of the Java Virtual Machine.
publicfinal String toString ()
  Getter for the programmatic name of the entire locale, with the language, country and variant separated by underbars.
Fields
Hide/Show inherited fields
publicfinalstatic Locale CANADA
Useful constant for country.
publicfinalstatic Locale CANADA_FRENCH
Useful constant for country.
publicfinalstatic Locale CHINA
Useful constant for country.
publicfinalstatic Locale CHINESE
Useful constant for language.
publicfinalstatic Locale ENGLISH
Useful constant for language.
publicfinalstatic Locale FRANCE
Useful constant for country.
publicfinalstatic Locale FRENCH
Useful constant for language.
publicfinalstatic Locale GERMAN
Useful constant for language.
publicfinalstatic Locale GERMANY
Useful constant for country.
publicfinalstatic Locale ITALIAN
Useful constant for language.
publicfinalstatic Locale ITALY
Useful constant for country.
publicfinalstatic Locale JAPAN
Useful constant for country.
publicfinalstatic Locale JAPANESE
Useful constant for language.
publicfinalstatic Locale KOREA
Useful constant for country.
publicfinalstatic Locale KOREAN
Useful constant for language.
publicfinalstatic Locale PRC
Useful constant for country.
publicfinalstatic Locale ROOT
  Useful constant for the root locale.
pack-privatefinalstatic long serialVersionUID = "9149081749638150636"
serialization ID
publicfinalstatic Locale SIMPLIFIED_CHINESE
Useful constant for language.
publicfinalstatic Locale TAIWAN
Useful constant for country.
publicfinalstatic Locale TRADITIONAL_CHINESE
Useful constant for language.
publicfinalstatic Locale UK
Useful constant for country.
publicfinalstatic Locale US
Useful constant for country.
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar