|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.Locale
public final class Locale
Locale represents a language/country/variant combination. It is an identifier which dictates particular conventions for the presentation of information. The language codes are two letter lowercase codes as defined by ISO-639. The country codes are three letter uppercase codes as defined by ISO-3166. The variant codes are unspecified.
ResourceBundle,
Serialized Form| Field Summary | |
|---|---|
static Locale |
CANADA
Locale constant for en_CA. |
static Locale |
CANADA_FRENCH
Locale constant for fr_CA. |
static Locale |
CHINA
Locale constant for zh_CN. |
static Locale |
CHINESE
Locale constant for zh. |
static Locale |
ENGLISH
Locale constant for en. |
static Locale |
FRANCE
Locale constant for fr_FR. |
static Locale |
FRENCH
Locale constant for fr. |
static Locale |
GERMAN
Locale constant for de. |
static Locale |
GERMANY
Locale constant for de_DE. |
static Locale |
ITALIAN
Locale constant for it. |
static Locale |
ITALY
Locale constant for it_IT. |
static Locale |
JAPAN
Locale constant for ja_JP. |
static Locale |
JAPANESE
Locale constant for ja. |
static Locale |
KOREA
Locale constant for ko_KR. |
static Locale |
KOREAN
Locale constant for ko. |
static Locale |
PRC
Locale constant for zh_CN. |
static Locale |
SIMPLIFIED_CHINESE
Locale constant for zh_CN. |
static Locale |
TAIWAN
Locale constant for zh_TW. |
static Locale |
TRADITIONAL_CHINESE
Locale constant for zh_TW. |
static Locale |
UK
Locale constant for en_GB. |
static Locale |
US
Locale constant for en_US. |
| Constructor Summary | |
|---|---|
Locale(String language)
Constructs a new Locale using the specified language. |
|
Locale(String language,
String country)
Constructs a new Locale using the specified language and country codes. |
|
Locale(String language,
String country,
String variant)
Constructs a new Locale using the specified language, country, and variant codes. |
|
| Method Summary | |
|---|---|
Object |
clone()
Returns a new Locale with the same language, country and variant codes as this Locale. |
boolean |
equals(Object object)
Compares the specified object to this Locale and answer if they are equal. |
(package private) static Locale[] |
find()
|
static Locale[] |
getAvailableLocales()
Gets the list of installed Locales. |
(package private) static ResourceBundle |
getBundle(String clName,
Locale locale)
|
String |
getCountry()
Gets the country code for this Locale. |
static Locale |
getDefault()
Gets the default Locale. |
String |
getDisplayCountry()
Gets the full country name in the default Locale for the country code of this Locale. |
String |
getDisplayCountry(Locale locale)
Gets the full country name in the specified Locale for the country code of this Locale. |
String |
getDisplayLanguage()
Gets the full language name in the default Locale for the language code of this Locale. |
String |
getDisplayLanguage(Locale locale)
Gets the full language name in the specified Locale for the language code of this Locale. |
String |
getDisplayName()
Gets the full language, country, and variant names in the default Locale for the codes of this Locale. |
String |
getDisplayName(Locale locale)
Gets the full language, country, and variant names in the specified Locale for the codes of this Locale. |
String |
getDisplayVariant()
Gets the full variant name in the default Locale for the variant code of this Locale. |
String |
getDisplayVariant(Locale locale)
Gets the full variant name in the specified Locale for the variant code of this Locale. |
String |
getISO3Country()
Gets the three letter ISO country code which corresponds to the country code for this Locale. |
String |
getISO3Language()
Gets the three letter ISO language code which corresponds to the language code for this Locale. |
static String[] |
getISOCountries()
Gets the list of two letter ISO country codes which can be used as the country code for a Locale. |
static String[] |
getISOLanguages()
Gets the list of two letter ISO language codes which can be used as the language code for a Locale. |
String |
getLanguage()
Gets the language code for this Locale. |
String |
getVariant()
Gets the variant code for this Locale. |
int |
hashCode()
Returns an integer hash code for the receiver. |
static void |
setDefault(Locale locale)
Sets the default Locale to the specified Locale. |
String |
toString()
Returns the string representation of this Locale. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final Locale CANADA
public static final Locale CANADA_FRENCH
public static final Locale CHINA
public static final Locale CHINESE
public static final Locale ENGLISH
public static final Locale FRANCE
public static final Locale FRENCH
public static final Locale GERMAN
public static final Locale GERMANY
public static final Locale ITALIAN
public static final Locale ITALY
public static final Locale JAPAN
public static final Locale JAPANESE
public static final Locale KOREA
public static final Locale KOREAN
public static final Locale PRC
public static final Locale SIMPLIFIED_CHINESE
public static final Locale TAIWAN
public static final Locale TRADITIONAL_CHINESE
public static final Locale UK
public static final Locale US
| Constructor Detail |
|---|
public Locale(String language)
language -
public Locale(String language,
String country)
language - country -
public Locale(String language,
String country,
String variant)
language - country - variant -
NullPointerException - if language,
country or variant is
null.| Method Detail |
|---|
public Object clone()
clone in class ObjectCloneablepublic boolean equals(Object object)
equals in class Objectobject - the object to compare with this object
hashCode()static Locale[] find()
public static Locale[] getAvailableLocales()
public String getCountry()
public static Locale getDefault()
public final String getDisplayCountry()
public String getDisplayCountry(Locale locale)
locale - the Locale
public final String getDisplayLanguage()
public String getDisplayLanguage(Locale locale)
locale - the Locale
public final String getDisplayName()
public String getDisplayName(Locale locale)
locale - the Locale
public final String getDisplayVariant()
public String getDisplayVariant(Locale locale)
locale - the Locale
public String getISO3Country()
throws MissingResourceException
MissingResourceException - when there is no matching three letter ISO country code
public String getISO3Language()
throws MissingResourceException
MissingResourceException - when there is no matching three letter ISO language codepublic static String[] getISOCountries()
public static String[] getISOLanguages()
public String getLanguage()
public String getVariant()
public int hashCode()
hashCode in class Objectequals(java.lang.Object)public static void setDefault(Locale locale)
locale - the new default Locale
SecurityException - when there is a security manager which does not allow this
operationpublic final String toString()
toString in class Object
static ResourceBundle getBundle(String clName,
Locale locale)
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||