Java Doc for ULocale.java in  » Internationalization-Localization » icu4j » com » ibm » icu » util » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Internationalization Localization » icu4j » com.ibm.icu.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.ibm.icu.util.ULocale

ULocale
final public class ULocale implements Serializable(Code)
A class analogous to java.util.Locale that provides additional support for ICU protocol. In ICU 3.0 this class is enhanced to support RFC 3066 language identifiers.

Many classes and services in ICU follow a factory idiom, in which a factory method or object responds to a client request with an object. The request includes a locale (the requested locale), and the returned object is constructed using data for that locale. The system may lack data for the requested locale, in which case the locale fallback mechanism will be invoked until a populated locale is found (the valid locale). Furthermore, even when a populated locale is found (the valid locale), further fallback may be required to reach a locale containing the specific data required by the service (the actual locale).

ULocale performs 'normalization' and 'canonicalization' of locale ids. Normalization 'cleans up' ICU locale ids as follows:

  • language, script, country, variant, and keywords are properly cased
    (lower, title, upper, upper, and lower case respectively)
  • hyphens used as separators are converted to underscores
  • three-letter language and country ids are converted to two-letter equivalents where available
  • surrounding spaces are removed from keywords and values
  • if there are multiple keywords, they are put in sorted order
Canonicalization additionally performs the following:
  • POSIX ids are converted to ICU format IDs
  • 'grandfathered' 3066 ids are converted to ICU standard form
  • 'PREEURO' and 'EURO' variants are converted to currency keyword form, with the currency id appropriate to the country of the locale (for PREEURO) or EUR (for EURO).
All ULocale constructors automatically normalize the locale id. To handle POSIX ids, canonicalize can be called to convert the id to canonical form, or the canonicalInstance factory method can be called.

This class provides selectors ULocale.VALID_LOCALE and ULocale.ACTUAL_LOCALE intended for use in methods named getLocale(). These methods exist in several ICU classes, including com.ibm.icu.util.Calendar , com.ibm.icu.util.Currency , com.ibm.icu.text.UFormat , com.ibm.icu.text.BreakIterator , com.ibm.icu.text.Collator , com.ibm.icu.text.DateFormatSymbols , and com.ibm.icu.text.DecimalFormatSymbols and their subclasses, if any. Once an object of one of these classes has been created, getLocale() may be called on it to determine the valid and actual locale arrived at during the object's construction.

Note: The getLocale() method will be implemented in ICU 3.0; ICU 2.8 contains a partial preview implementation. The actual locale is returned correctly, but the valid locale is not, in most cases.
See Also:   java.util.Locale
author:
   weiv
author:
   Alan Liu
author:
   Ram Viswanadha


Inner Class :final public static class Type

Field Summary
public static  TypeACTUAL_LOCALE
     Selector for getLocale() indicating the locale of the resource containing the data.
final public static  ULocaleCANADA
     Useful constant for country/region.
final public static  ULocaleCANADA_FRENCH
     Useful constant for country/region.
final public static  ULocaleCHINA
     Useful constant for country/region.
final public static  ULocaleCHINESE
     Useful constant for language.
final public static  ULocaleENGLISH
     Useful constant for language.
final public static  ULocaleFRANCE
     Useful constant for country/region.
final public static  ULocaleFRENCH
     Useful constant for language.
final public static  ULocaleGERMAN
     Useful constant for language.
final public static  ULocaleGERMANY
     Useful constant for country/region.
final public static  ULocaleITALIAN
     Useful constant for language.
final public static  ULocaleITALY
     Useful constant for country/region.
final public static  ULocaleJAPAN
     Useful constant for country/region.
final public static  ULocaleJAPANESE
     Useful constant for language.
final public static  ULocaleKOREA
     Useful constant for country/region.
final public static  ULocaleKOREAN
     Useful constant for language.
final public static  ULocalePRC
     Useful constant for country/region.
final public static  ULocaleROOT
     The root ULocale.
final public static  ULocaleSIMPLIFIED_CHINESE
     Useful constant for language.
final public static  ULocaleTAIWAN
     Useful constant for country/region.
final public static  ULocaleTRADITIONAL_CHINESE
     Useful constant for language.
final public static  ULocaleUK
     Useful constant for country/region.
final public static  ULocaleUS
     Useful constant for country/region.
public static  TypeVALID_LOCALE
     Selector for getLocale() indicating the most specific locale for which any data exists.

Constructor Summary
public  ULocale(String localeID)
     Construct a ULocale from a RFC 3066 locale ID.
public  ULocale(String a, String b)
     Convenience overload of ULocale(String, String, String) for compatibility with java.util.Locale.
public  ULocale(String a, String b, String c)
     Construct a ULocale from a localeID constructed from the three 'fields' a, b, and c.

Method Summary
public static  ULocaleacceptLanguage(String acceptLanguageList, ULocale[] availableLocales, boolean[] fallback)
     Based on a HTTP formatted list of acceptable locales, determine an available locale for the user. NullPointerException is thrown if acceptLanguageList or availableLocales is null.
public static  ULocaleacceptLanguage(ULocale[] acceptLanguageList, ULocale[] availableLocales, boolean[] fallback)
     Based on a list of acceptable locales, determine an available locale for the user. NullPointerException is thrown if acceptLanguageList or availableLocales is null.
public static  ULocaleacceptLanguage(String acceptLanguageList, boolean[] fallback)
     Based on a HTTP formatted list of acceptable locales, determine an available locale for the user. NullPointerException is thrown if acceptLanguageList or availableLocales is null.
public static  ULocaleacceptLanguage(ULocale[] acceptLanguageList, boolean[] fallback)
     Based on an ordered array of acceptable locales, determine an available locale for the user. NullPointerException is thrown if acceptLanguageList or availableLocales is null.
public static  Stringcanonicalize(String localeID)
     Returns the canonical name for the specified locale ID.
public  Objectclone()
     This is for compatibility with Locale-- in actuality, since ULocale is immutable, there is no reason to clone it, so this API returns 'this'.
public static  ULocalecreateCanonical(String nonCanonicalID)
     Create a ULocale from the id by first canonicalizing the id.
public  booleanequals(Object obj)
     Returns true if the other object is another ULocale with the same full name, or is a String localeID that matches the full name.
public static  ULocaleforLocale(Locale loc)
     Return a ULocale object for a java.util.Locale .
public static  ULocale[]getAvailableLocales()
     Returns a list of all installed locales.
public  StringgetBaseName()
     Returns the (normalized) base name for this locale.
public static  StringgetBaseName(String localeID)
     Returns the (normalized) base name for the specified locale.
public  StringgetCountry()
     Returns the country/region code for this locale, which will either be the empty string or an uppercase ISO 3166 2-letter code.
public static  StringgetCountry(String localeID)
     Returns the country/region code for this locale, which will either be the empty string or an uppercase ISO 3166 2-letter code.
static  StringgetCurrentCountryID(String oldID)
    
static  StringgetCurrentLanguageID(String oldID)
    
public static  ULocalegetDefault()
     Returns the current default ULocale.
public  StringgetDisplayCountry()
     Returns this locale's country localized for display in the default locale.
public  StringgetDisplayCountry(ULocale displayLocale)
     Returns this locale's country localized for display in the provided locale.
Parameters:
  displayLocale - the locale in which to display the name.
public static  StringgetDisplayCountry(String localeID, String displayLocaleID)
     Returns a locale's country localized for display in the provided locale. This is a cover for the ICU4C API.
Parameters:
  localeID - the id of the locale whose country will be displayed
Parameters:
  displayLocaleID - the id of the locale in which to display the name.
public static  StringgetDisplayCountry(String localeID, ULocale displayLocale)
     Returns a locale's country localized for display in the provided locale. This is a cover for the ICU4C API.
Parameters:
  localeID - the id of the locale whose country will be displayed.
Parameters:
  displayLocale - the locale in which to display the name.
public static  StringgetDisplayKeyword(String keyword)
     Returns a keyword localized for display in the default locale.
Parameters:
  keyword - the keyword to be displayed.
public static  StringgetDisplayKeyword(String keyword, String displayLocaleID)
     Returns a keyword localized for display in the specified locale.
Parameters:
  keyword - the keyword to be displayed.
Parameters:
  displayLocaleID - the id of the locale in which to display the keyword.
public static  StringgetDisplayKeyword(String keyword, ULocale displayLocale)
     Returns a keyword localized for display in the specified locale.
Parameters:
  keyword - the keyword to be displayed.
Parameters:
  displayLocale - the locale in which to display the keyword.
public  StringgetDisplayKeywordValue(String keyword)
     Returns a keyword value localized for display in the default locale.
Parameters:
  keyword - the keyword whose value is to be displayed.
public  StringgetDisplayKeywordValue(String keyword, ULocale displayLocale)
     Returns a keyword value localized for display in the specified locale.
Parameters:
  keyword - the keyword whose value is to be displayed.
Parameters:
  displayLocale - the locale in which to display the value.
public static  StringgetDisplayKeywordValue(String localeID, String keyword, String displayLocaleID)
     Returns a keyword value localized for display in the specified locale. This is a cover for the ICU4C API.
Parameters:
  localeID - the id of the locale whose keyword value is to be displayed.
Parameters:
  keyword - the keyword whose value is to be displayed.
Parameters:
  displayLocaleID - the id of the locale in which to display the value.
public static  StringgetDisplayKeywordValue(String localeID, String keyword, ULocale displayLocale)
     Returns a keyword value localized for display in the specified locale. This is a cover for the ICU4C API.
Parameters:
  localeID - the id of the locale whose keyword value is to be displayed.
Parameters:
  keyword - the keyword whose value is to be displayed.
Parameters:
  displayLocale - the id of the locale in which to display the value.
public  StringgetDisplayLanguage()
     Returns this locale's language localized for display in the default locale.
public  StringgetDisplayLanguage(ULocale displayLocale)
     Returns this locale's language localized for display in the provided locale.
Parameters:
  displayLocale - the locale in which to display the name.
public static  StringgetDisplayLanguage(String localeID, String displayLocaleID)
     Returns a locale's language localized for display in the provided locale. This is a cover for the ICU4C API.
Parameters:
  localeID - the id of the locale whose language will be displayed
Parameters:
  displayLocaleID - the id of the locale in which to display the name.
public static  StringgetDisplayLanguage(String localeID, ULocale displayLocale)
     Returns a locale's language localized for display in the provided locale. This is a cover for the ICU4C API.
Parameters:
  localeID - the id of the locale whose language will be displayed.
Parameters:
  displayLocale - the locale in which to display the name.
public  StringgetDisplayName()
     Returns this locale name localized for display in the default locale.
public  StringgetDisplayName(ULocale displayLocale)
     Returns this locale name localized for display in the provided locale.
Parameters:
  displayLocale - the locale in which to display the locale name.
public static  StringgetDisplayName(String localeID, String displayLocaleID)
     Returns the locale ID localized for display in the provided locale. This is a cover for the ICU4C API.
Parameters:
  localeID - the locale whose name is to be displayed.
Parameters:
  displayLocaleID - the id of the locale in which to display the locale name.
public static  StringgetDisplayName(String localeID, ULocale displayLocale)
     Returns the locale ID localized for display in the provided locale. This is a cover for the ICU4C API.
Parameters:
  localeID - the locale whose name is to be displayed.
Parameters:
  displayLocale - the locale in which to display the locale name.
public  StringgetDisplayScript()
     Returns this locale's script localized for display in the default locale.
public  StringgetDisplayScript(ULocale displayLocale)
     Returns this locale's script localized for display in the provided locale.
Parameters:
  displayLocale - the locale in which to display the name.
public static  StringgetDisplayScript(String localeID, String displayLocaleID)
     Returns a locale's script localized for display in the provided locale. This is a cover for the ICU4C API.
Parameters:
  localeID - the id of the locale whose script will be displayed
Parameters:
  displayLocaleID - the id of the locale in which to display the name.
public static  StringgetDisplayScript(String localeID, ULocale displayLocale)
     Returns a locale's script localized for display in the provided locale.
Parameters:
  localeID - the id of the locale whose script will be displayed.
Parameters:
  displayLocale - the locale in which to display the name.
public  StringgetDisplayVariant()
     Returns this locale's variant localized for display in the default locale.
public  StringgetDisplayVariant(ULocale displayLocale)
     Returns this locale's variant localized for display in the provided locale.
Parameters:
  displayLocale - the locale in which to display the name.
public static  StringgetDisplayVariant(String localeID, String displayLocaleID)
     Returns a locale's variant localized for display in the provided locale. This is a cover for the ICU4C API.
Parameters:
  localeID - the id of the locale whose variant will be displayed
Parameters:
  displayLocaleID - the id of the locale in which to display the name.
public static  StringgetDisplayVariant(String localeID, ULocale displayLocale)
     Returns a locale's variant localized for display in the provided locale. This is a cover for the ICU4C API.
Parameters:
  localeID - the id of the locale whose variant will be displayed.
Parameters:
  displayLocale - the locale in which to display the name.
public static  StringgetFallback(String localeID)
     Returns the fallback locale for the specified locale, which might be the empty string.
public  ULocalegetFallback()
     Returns the fallback locale for this locale.
public  StringgetISO3Country()
     Returns a three-letter abbreviation for this locale's country/region.
public static  StringgetISO3Country(String localeID)
     Returns a three-letter abbreviation for this locale's country/region.
public  StringgetISO3Language()
     Returns a three-letter abbreviation for this locale's language.
public static  StringgetISO3Language(String localeID)
     Returns a three-letter abbreviation for this locale's 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.
public  StringgetKeywordValue(String keywordName)
     Returns the value for a keyword in this locale.
public static  StringgetKeywordValue(String localeID, String keywordName)
     Returns the value for a keyword in the specified locale.
public  IteratorgetKeywords()
     Returns an iterator over keywords for this locale.
public static  IteratorgetKeywords(String localeID)
     Returns an iterator over keywords for the specified locale.
public  StringgetLanguage()
     Returns the language code for this locale, which will either be the empty string or a lowercase ISO 639 code.
public static  StringgetLanguage(String localeID)
     Returns the language code for the locale ID, which will either be the empty string or a lowercase ISO 639 code.
public  StringgetName()
     Returns the (normalized) full name for this locale.
public static  StringgetName(String localeID)
     Returns the (normalized) full name for the specified locale.
public  StringgetScript()
     Returns the script code for this locale, which might be the empty string.
public static  StringgetScript(String localeID)
     Returns the script code for the specified locale, which might be the empty string.
public  StringgetVariant()
     Returns the variant code for this locale, which might be the empty string.
public static  StringgetVariant(String localeID)
     Returns the variant code for the specified locale, which might be the empty string.
public  inthashCode()
     Returns the hashCode.
public static synchronized  voidsetDefault(ULocale newLocale)
     Sets the default ULocale.
public  ULocalesetKeywordValue(String keyword, String value)
     Given a keyword and a value, return a new locale with an updated keyword and value.
public static  StringsetKeywordValue(String localeID, String keyword, String value)
     Given a locale id, a keyword, and a value, return a new locale id with an updated keyword and value.
public  LocaletoLocale()
     Convert this ULocale object to a java.util.Locale .
public  StringtoString()
     Returns a string representation of this object.

Field Detail
ACTUAL_LOCALE
public static Type ACTUAL_LOCALE(Code)
Selector for getLocale() indicating the locale of the resource containing the data. This is always at or above the valid locale. If the valid locale does not contain the specific data being requested, then the actual locale will be above the valid locale. If the object was not constructed from locale data, then the valid locale is null.



CANADA
final public static ULocale CANADA(Code)
Useful constant for country/region.



CANADA_FRENCH
final public static ULocale CANADA_FRENCH(Code)
Useful constant for country/region.



CHINA
final public static ULocale CHINA(Code)
Useful constant for country/region.



CHINESE
final public static ULocale CHINESE(Code)
Useful constant for language.



ENGLISH
final public static ULocale ENGLISH(Code)
Useful constant for language.



FRANCE
final public static ULocale FRANCE(Code)
Useful constant for country/region.



FRENCH
final public static ULocale FRENCH(Code)
Useful constant for language.



GERMAN
final public static ULocale GERMAN(Code)
Useful constant for language.



GERMANY
final public static ULocale GERMANY(Code)
Useful constant for country/region.



ITALIAN
final public static ULocale ITALIAN(Code)
Useful constant for language.



ITALY
final public static ULocale ITALY(Code)
Useful constant for country/region.



JAPAN
final public static ULocale JAPAN(Code)
Useful constant for country/region.



JAPANESE
final public static ULocale JAPANESE(Code)
Useful constant for language.



KOREA
final public static ULocale KOREA(Code)
Useful constant for country/region.



KOREAN
final public static ULocale KOREAN(Code)
Useful constant for language.



PRC
final public static ULocale PRC(Code)
Useful constant for country/region.



ROOT
final public static ULocale ROOT(Code)
The root ULocale.



SIMPLIFIED_CHINESE
final public static ULocale SIMPLIFIED_CHINESE(Code)
Useful constant for language.



TAIWAN
final public static ULocale TAIWAN(Code)
Useful constant for country/region.



TRADITIONAL_CHINESE
final public static ULocale TRADITIONAL_CHINESE(Code)
Useful constant for language.



UK
final public static ULocale UK(Code)
Useful constant for country/region.



US
final public static ULocale US(Code)
Useful constant for country/region.



VALID_LOCALE
public static Type VALID_LOCALE(Code)
Selector for getLocale() indicating the most specific locale for which any data exists. This is always at or above the requested locale, and at or below the actual locale. If the requested locale does not correspond to any resource data, then the valid locale will be above the requested locale. If the object was not constructed from locale data, then the actual locale is null.

Note: The valid locale will be returned correctly in ICU 3.0 or later. In ICU 2.8, it is not returned correctly.





Constructor Detail
ULocale
public ULocale(String localeID)(Code)
Construct a ULocale from a RFC 3066 locale ID. The locale ID consists of optional language, script, country, and variant fields in that order, separated by underscores, followed by an optional keyword list. The script, if present, is four characters long-- this distinguishes it from a country code, which is two characters long. Other fields are distinguished by position as indicated by the underscores. The start of the keyword list is indicated by '@', and consists of one or more keyword/value pairs separated by commas.

This constructor does not canonicalize the localeID.
Parameters:
  localeID - string representation of the locale, e.g:"en_US", "sy_Cyrl_YU", "zh__pinyin", "es_ES@currency=EUR,collation=traditional"




ULocale
public ULocale(String a, String b)(Code)
Convenience overload of ULocale(String, String, String) for compatibility with java.util.Locale.
See Also:   ULocale.ULocale(String,String,String)



ULocale
public ULocale(String a, String b, String c)(Code)
Construct a ULocale from a localeID constructed from the three 'fields' a, b, and c. These fields are concatenated using underscores to form a localeID of the form a_b_c, which is then handled like the localeID passed to ULocale(String localeID).

Java locale strings consisting of language, country, and variant will be handled by this form, since the country code (being shorter than four letters long) will not be interpreted as a script code. If a script code is present, the final argument ('c') will be interpreted as the country code. It is recommended that this constructor only be used to ease porting, and that clients instead use the single-argument constructor when constructing a ULocale from a localeID.
Parameters:
  a - first component of the locale id
Parameters:
  b - second component of the locale id
Parameters:
  c - third component of the locale id
See Also:   ULocale.ULocale(String)





Method Detail
acceptLanguage
public static ULocale acceptLanguage(String acceptLanguageList, ULocale[] availableLocales, boolean[] fallback)(Code)
Based on a HTTP formatted list of acceptable locales, determine an available locale for the user. NullPointerException is thrown if acceptLanguageList or availableLocales is null. If fallback is non-null, it will contain true if a fallback locale (one not in the acceptLanguageList) was returned. The value on entry is ignored. ULocale will be one of the locales in availableLocales, or the ROOT ULocale if if a ROOT locale was used as a fallback (because nothing else in availableLocales matched). No ULocale array element should be null; behavior is undefined if this is the case.
Parameters:
  acceptLanguageList - list in HTTP "Accept-Language:" format of acceptable locales
Parameters:
  availableLocales - list of available locales. One of these will be returned.
Parameters:
  fallback - if non-null, a 1-element array containing a boolean to be set with the fallback status one of the locales from the availableLocales list, or null if none match



acceptLanguage
public static ULocale acceptLanguage(ULocale[] acceptLanguageList, ULocale[] availableLocales, boolean[] fallback)(Code)
Based on a list of acceptable locales, determine an available locale for the user. NullPointerException is thrown if acceptLanguageList or availableLocales is null. If fallback is non-null, it will contain true if a fallback locale (one not in the acceptLanguageList) was returned. The value on entry is ignored. ULocale will be one of the locales in availableLocales, or the ROOT ULocale if if a ROOT locale was used as a fallback (because nothing else in availableLocales matched). No ULocale array element should be null; behavior is undefined if this is the case.
Parameters:
  acceptLanguageList - list of acceptable locales
Parameters:
  availableLocales - list of available locales. One of these will be returned.
Parameters:
  fallback - if non-null, a 1-element array containing a boolean to be set with the fallback status one of the locales from the availableLocales list, or null if none match



acceptLanguage
public static ULocale acceptLanguage(String acceptLanguageList, boolean[] fallback)(Code)
Based on a HTTP formatted list of acceptable locales, determine an available locale for the user. NullPointerException is thrown if acceptLanguageList or availableLocales is null. If fallback is non-null, it will contain true if a fallback locale (one not in the acceptLanguageList) was returned. The value on entry is ignored. ULocale will be one of the locales in availableLocales, or the ROOT ULocale if if a ROOT locale was used as a fallback (because nothing else in availableLocales matched). No ULocale array element should be null; behavior is undefined if this is the case. This function will choose a locale from the ULocale.getAvailableLocales() list as available.
Parameters:
  acceptLanguageList - list in HTTP "Accept-Language:" format of acceptable locales
Parameters:
  fallback - if non-null, a 1-element array containing a boolean to be set with the fallback status one of the locales from the ULocale.getAvailableLocales() list, or null if none match



acceptLanguage
public static ULocale acceptLanguage(ULocale[] acceptLanguageList, boolean[] fallback)(Code)
Based on an ordered array of acceptable locales, determine an available locale for the user. NullPointerException is thrown if acceptLanguageList or availableLocales is null. If fallback is non-null, it will contain true if a fallback locale (one not in the acceptLanguageList) was returned. The value on entry is ignored. ULocale will be one of the locales in availableLocales, or the ROOT ULocale if if a ROOT locale was used as a fallback (because nothing else in availableLocales matched). No ULocale array element should be null; behavior is undefined if this is the case. This function will choose a locale from the ULocale.getAvailableLocales() list as available.
Parameters:
  acceptLanguageList - ordered array of acceptable locales (preferred are listed first)
Parameters:
  fallback - if non-null, a 1-element array containing a boolean to be set with the fallback status one of the locales from the ULocale.getAvailableLocales() list, or null if none match



canonicalize
public static String canonicalize(String localeID)(Code)
Returns the canonical name for the specified locale ID. This is used to convert POSIX and other grandfathered IDs to standard ICU form.
Parameters:
  localeID - the locale id the canonicalized id



clone
public Object clone()(Code)
This is for compatibility with Locale-- in actuality, since ULocale is immutable, there is no reason to clone it, so this API returns 'this'.



createCanonical
public static ULocale createCanonical(String nonCanonicalID)(Code)
Create a ULocale from the id by first canonicalizing the id.
Parameters:
  nonCanonicalID - the locale id to canonicalize the locale created from the canonical version of the ID.



equals
public boolean equals(Object obj)(Code)
Returns true if the other object is another ULocale with the same full name, or is a String localeID that matches the full name. Note that since names are not canonicalized, two ULocales that function identically might not compare equal. true if this Locale is equal to the specified object.



forLocale
public static ULocale forLocale(Locale loc)(Code)
Return a ULocale object for a java.util.Locale . The ULocale is canonicalized.
Parameters:
  loc - a JDK locale



getAvailableLocales
public static ULocale[] getAvailableLocales()(Code)
Returns a list of all installed locales.



getBaseName
public String getBaseName()(Code)
Returns the (normalized) base name for this locale. the base name as a String.



getBaseName
public static String getBaseName(String localeID)(Code)
Returns the (normalized) base name for the specified locale.
Parameters:
  localeID - the locale ID as a string the base name as a String.



getCountry
public String getCountry()(Code)
Returns the country/region code for this locale, which will either be the empty string or an uppercase ISO 3166 2-letter code.
See Also:   ULocale.getDisplayCountry



getCountry
public static String getCountry(String localeID)(Code)
Returns the country/region code for this locale, which will either be the empty string or an uppercase ISO 3166 2-letter code.
Parameters:
  localeID -
See Also:   ULocale.getDisplayCountry



getCurrentCountryID
static String getCurrentCountryID(String oldID)(Code)



getCurrentLanguageID
static String getCurrentLanguageID(String oldID)(Code)



getDefault
public static ULocale getDefault()(Code)
Returns the current default ULocale.



getDisplayCountry
public String getDisplayCountry()(Code)
Returns this locale's country localized for display in the default locale. the localized country name.



getDisplayCountry
public String getDisplayCountry(ULocale displayLocale)(Code)
Returns this locale's country localized for display in the provided locale.
Parameters:
  displayLocale - the locale in which to display the name. the localized country name.



getDisplayCountry
public static String getDisplayCountry(String localeID, String displayLocaleID)(Code)
Returns a locale's country localized for display in the provided locale. This is a cover for the ICU4C API.
Parameters:
  localeID - the id of the locale whose country will be displayed
Parameters:
  displayLocaleID - the id of the locale in which to display the name. the localized country name.



getDisplayCountry
public static String getDisplayCountry(String localeID, ULocale displayLocale)(Code)
Returns a locale's country localized for display in the provided locale. This is a cover for the ICU4C API.
Parameters:
  localeID - the id of the locale whose country will be displayed.
Parameters:
  displayLocale - the locale in which to display the name. the localized country name.



getDisplayKeyword
public static String getDisplayKeyword(String keyword)(Code)
Returns a keyword localized for display in the default locale.
Parameters:
  keyword - the keyword to be displayed. the localized keyword name.
See Also:   ULocale.getKeywords



getDisplayKeyword
public static String getDisplayKeyword(String keyword, String displayLocaleID)(Code)
Returns a keyword localized for display in the specified locale.
Parameters:
  keyword - the keyword to be displayed.
Parameters:
  displayLocaleID - the id of the locale in which to display the keyword. the localized keyword name.
See Also:   ULocale.getKeywords



getDisplayKeyword
public static String getDisplayKeyword(String keyword, ULocale displayLocale)(Code)
Returns a keyword localized for display in the specified locale.
Parameters:
  keyword - the keyword to be displayed.
Parameters:
  displayLocale - the locale in which to display the keyword. the localized keyword name.
See Also:   ULocale.getKeywords



getDisplayKeywordValue
public String getDisplayKeywordValue(String keyword)(Code)
Returns a keyword value localized for display in the default locale.
Parameters:
  keyword - the keyword whose value is to be displayed. the localized value name.



getDisplayKeywordValue
public String getDisplayKeywordValue(String keyword, ULocale displayLocale)(Code)
Returns a keyword value localized for display in the specified locale.
Parameters:
  keyword - the keyword whose value is to be displayed.
Parameters:
  displayLocale - the locale in which to display the value. the localized value name.



getDisplayKeywordValue
public static String getDisplayKeywordValue(String localeID, String keyword, String displayLocaleID)(Code)
Returns a keyword value localized for display in the specified locale. This is a cover for the ICU4C API.
Parameters:
  localeID - the id of the locale whose keyword value is to be displayed.
Parameters:
  keyword - the keyword whose value is to be displayed.
Parameters:
  displayLocaleID - the id of the locale in which to display the value. the localized value name.



getDisplayKeywordValue
public static String getDisplayKeywordValue(String localeID, String keyword, ULocale displayLocale)(Code)
Returns a keyword value localized for display in the specified locale. This is a cover for the ICU4C API.
Parameters:
  localeID - the id of the locale whose keyword value is to be displayed.
Parameters:
  keyword - the keyword whose value is to be displayed.
Parameters:
  displayLocale - the id of the locale in which to display the value. the localized value name.



getDisplayLanguage
public String getDisplayLanguage()(Code)
Returns this locale's language localized for display in the default locale. the localized language name.



getDisplayLanguage
public String getDisplayLanguage(ULocale displayLocale)(Code)
Returns this locale's language localized for display in the provided locale.
Parameters:
  displayLocale - the locale in which to display the name. the localized language name.



getDisplayLanguage
public static String getDisplayLanguage(String localeID, String displayLocaleID)(Code)
Returns a locale's language localized for display in the provided locale. This is a cover for the ICU4C API.
Parameters:
  localeID - the id of the locale whose language will be displayed
Parameters:
  displayLocaleID - the id of the locale in which to display the name. the localized language name.



getDisplayLanguage
public static String getDisplayLanguage(String localeID, ULocale displayLocale)(Code)
Returns a locale's language localized for display in the provided locale. This is a cover for the ICU4C API.
Parameters:
  localeID - the id of the locale whose language will be displayed.
Parameters:
  displayLocale - the locale in which to display the name. the localized language name.



getDisplayName
public String getDisplayName()(Code)
Returns this locale name localized for display in the default locale. the localized locale name.



getDisplayName
public String getDisplayName(ULocale displayLocale)(Code)
Returns this locale name localized for display in the provided locale.
Parameters:
  displayLocale - the locale in which to display the locale name. the localized locale name.



getDisplayName
public static String getDisplayName(String localeID, String displayLocaleID)(Code)
Returns the locale ID localized for display in the provided locale. This is a cover for the ICU4C API.
Parameters:
  localeID - the locale whose name is to be displayed.
Parameters:
  displayLocaleID - the id of the locale in which to display the locale name. the localized locale name.



getDisplayName
public static String getDisplayName(String localeID, ULocale displayLocale)(Code)
Returns the locale ID localized for display in the provided locale. This is a cover for the ICU4C API.
Parameters:
  localeID - the locale whose name is to be displayed.
Parameters:
  displayLocale - the locale in which to display the locale name. the localized locale name.



getDisplayScript
public String getDisplayScript()(Code)
Returns this locale's script localized for display in the default locale. the localized script name.



getDisplayScript
public String getDisplayScript(ULocale displayLocale)(Code)
Returns this locale's script localized for display in the provided locale.
Parameters:
  displayLocale - the locale in which to display the name. the localized script name.



getDisplayScript
public static String getDisplayScript(String localeID, String displayLocaleID)(Code)
Returns a locale's script localized for display in the provided locale. This is a cover for the ICU4C API.
Parameters:
  localeID - the id of the locale whose script will be displayed
Parameters:
  displayLocaleID - the id of the locale in which to display the name. the localized script name.



getDisplayScript
public static String getDisplayScript(String localeID, ULocale displayLocale)(Code)
Returns a locale's script localized for display in the provided locale.
Parameters:
  localeID - the id of the locale whose script will be displayed.
Parameters:
  displayLocale - the locale in which to display the name. the localized script name.



getDisplayVariant
public String getDisplayVariant()(Code)
Returns this locale's variant localized for display in the default locale. the localized variant name.



getDisplayVariant
public String getDisplayVariant(ULocale displayLocale)(Code)
Returns this locale's variant localized for display in the provided locale.
Parameters:
  displayLocale - the locale in which to display the name. the localized variant name.



getDisplayVariant
public static String getDisplayVariant(String localeID, String displayLocaleID)(Code)
Returns a locale's variant localized for display in the provided locale. This is a cover for the ICU4C API.
Parameters:
  localeID - the id of the locale whose variant will be displayed
Parameters:
  displayLocaleID - the id of the locale in which to display the name. the localized variant name.



getDisplayVariant
public static String getDisplayVariant(String localeID, ULocale displayLocale)(Code)
Returns a locale's variant localized for display in the provided locale. This is a cover for the ICU4C API.
Parameters:
  localeID - the id of the locale whose variant will be displayed.
Parameters:
  displayLocale - the locale in which to display the name. the localized variant name.



getFallback
public static String getFallback(String localeID)(Code)
Returns the fallback locale for the specified locale, which might be the empty string.



getFallback
public ULocale getFallback()(Code)
Returns the fallback locale for this locale. If this locale is root, returns null.



getISO3Country
public String getISO3Country()(Code)
Returns a three-letter abbreviation for this locale's country/region. If the locale doesn't specify a country, returns the empty string. Otherwise, returns an uppercase ISO 3166 3-letter country code.
exception:
  MissingResourceException - Throws MissingResourceException if thethree-letter country abbreviation is not available for this locale.



getISO3Country
public static String getISO3Country(String localeID)(Code)
Returns a three-letter abbreviation for this locale's country/region. If the locale doesn't specify a country, returns the empty string. Otherwise, returns an uppercase ISO 3166 3-letter country code.
exception:
  MissingResourceException - Throws MissingResourceException if thethree-letter country abbreviation is not available for this locale.



getISO3Language
public String getISO3Language()(Code)
Returns a three-letter abbreviation for this locale's language. If the locale doesn't specify a language, 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
exception:
  MissingResourceException - Throws MissingResourceException if thethree-letter language abbreviation is not available for this locale.



getISO3Language
public static String getISO3Language(String localeID)(Code)
Returns a three-letter abbreviation for this locale's language. If the locale doesn't specify a language, 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
exception:
  MissingResourceException - Throws MissingResourceException if thethree-letter language abbreviation is not available for this locale.



getISOCountries
public static String[] getISOCountries()(Code)
Returns a list of all 2-letter country codes defined in ISO 3166. Can be used to create Locales.



getISOLanguages
public static String[] getISOLanguages()(Code)
Returns a list of all 2-letter language codes defined in ISO 639. 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.]



getKeywordValue
public String getKeywordValue(String keywordName)(Code)
Returns the value for a keyword in this locale. If the keyword is not defined, returns null.
Parameters:
  keywordName - name of the keyword whose value is desired. Case insensitive. the value of the keyword, or null.



getKeywordValue
public static String getKeywordValue(String localeID, String keywordName)(Code)
Returns the value for a keyword in the specified locale. If the keyword is not defined, returns null. The locale name does not need to be normalized.
Parameters:
  keywordName - name of the keyword whose value is desired. Case insensitive. String the value of the keyword as a string



getKeywords
public Iterator getKeywords()(Code)
Returns an iterator over keywords for this locale. If there are no keywords, returns null. iterator over keywords, or null if there are no keywords.



getKeywords
public static Iterator getKeywords(String localeID)(Code)
Returns an iterator over keywords for the specified locale. If there are no keywords, returns null. an iterator over the keywords in the specified locale, or nullif there are no keywords.



getLanguage
public String getLanguage()(Code)
Returns the language code for this locale, which will either be the empty string or a lowercase ISO 639 code.
See Also:   ULocale.getDisplayLanguage



getLanguage
public static String getLanguage(String localeID)(Code)
Returns the language code for the locale ID, which will either be the empty string or a lowercase ISO 639 code.
See Also:   ULocale.getDisplayLanguage



getName
public String getName()(Code)
Returns the (normalized) full name for this locale. String the full name of the localeID



getName
public static String getName(String localeID)(Code)
Returns the (normalized) full name for the specified locale.
Parameters:
  localeID - the localeID as a string String the full name of the localeID



getScript
public String getScript()(Code)
Returns the script code for this locale, which might be the empty string.
See Also:   ULocale.getDisplayScript



getScript
public static String getScript(String localeID)(Code)
Returns the script code for the specified locale, which might be the empty string.
See Also:   ULocale.getDisplayScript



getVariant
public String getVariant()(Code)
Returns the variant code for this locale, which might be the empty string.
See Also:   ULocale.getDisplayVariant



getVariant
public static String getVariant(String localeID)(Code)
Returns the variant code for the specified locale, which might be the empty string.
See Also:   ULocale.getDisplayVariant



hashCode
public int hashCode()(Code)
Returns the hashCode.



setDefault
public static synchronized void setDefault(ULocale newLocale)(Code)
Sets the default ULocale. This also sets the default Locale. If the caller does not have write permission to the user.language property, a security exception will be thrown, and the default ULocale will remain unchanged.
Parameters:
  newLocale - the new default locale
throws:
  SecurityException - if a security manager exists and itscheckPermission method doesn't allow the operation.
throws:
  NullPointerException - if newLocale is null
See Also:   SecurityManager.checkPermission
See Also:   java.util.PropertyPermission



setKeywordValue
public ULocale setKeywordValue(String keyword, String value)(Code)
Given a keyword and a value, return a new locale with an updated keyword and value. If keyword is null, this removes all keywords from the locale id. Otherwise, if the value is null, this removes the value for this keyword from the locale id. Otherwise, this adds/replaces the value for this keyword in the locale id. The keyword and value must not be empty.
Parameters:
  keyword - the keyword to add/remove, or null to remove all keywords.
Parameters:
  value - the value to add/set, or null to remove this particular keyword. the updated locale



setKeywordValue
public static String setKeywordValue(String localeID, String keyword, String value)(Code)
Given a locale id, a keyword, and a value, return a new locale id with an updated keyword and value. If keyword is null, this removes all keywords from the locale id. Otherwise, if the value is null, this removes the value for this keyword from the locale id. Otherwise, this adds/replaces the value for this keyword in the locale id. The keyword and value must not be empty.
Parameters:
  localeID - the locale id to modify
Parameters:
  keyword - the keyword to add/remove, or null to remove all keywords.
Parameters:
  value - the value to add/set, or null to remove this particular keyword. the updated locale id



toLocale
public Locale toLocale()(Code)
Convert this ULocale object to a java.util.Locale . a JDK locale that either exactly represents this objector is the closest approximation.



toString
public String toString()(Code)
Returns a string representation of this object.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.