com.ibm.icu.text
Class LocaleDisplayNames

java.lang.Object
  extended by com.ibm.icu.text.LocaleDisplayNames

public abstract class LocaleDisplayNames
extends Object

Returns display names of ULocales and components of ULocales. For more information on language, script, region, variant, key, and values, see ULocale.

Status:
Stable ICU 4.4.

Nested Class Summary
static class LocaleDisplayNames.DialectHandling
          Enum used in getInstance(ULocale, DialectHandling).
 
Constructor Summary
protected LocaleDisplayNames()
          Deprecated. This API is ICU internal only.
 
Method Summary
abstract  LocaleDisplayNames.DialectHandling getDialectHandling()
          Returns the dialect handling used in the display names.
static LocaleDisplayNames getInstance(ULocale locale)
          Convenience overload of getInstance(ULocale, DialectHandling) that specifies STANDARD dialect handling.
static LocaleDisplayNames getInstance(ULocale locale, LocaleDisplayNames.DialectHandling dialectHandling)
          Returns an instance of LocaleDisplayNames that returns names formatted for the provided locale, using the provided dialectHandling.
abstract  ULocale getLocale()
          Returns the locale used to determine the display names.
abstract  String keyDisplayName(String key)
          Returns the display name of the provided locale key.
abstract  String keyValueDisplayName(String key, String value)
          Returns the display name of the provided value (used with the provided key).
abstract  String languageDisplayName(String lang)
          Returns the display name of the provided language code.
abstract  String localeDisplayName(Locale locale)
          Returns the display name of the provided locale.
abstract  String localeDisplayName(String localeId)
          Returns the display name of the provided locale id.
abstract  String localeDisplayName(ULocale locale)
          Returns the display name of the provided ulocale.
abstract  String regionDisplayName(String region)
          Returns the display name of the provided region code.
abstract  String scriptDisplayName(int scriptCode)
          Returns the display name of the provided script code.
abstract  String scriptDisplayName(String script)
          Returns the display name of the provided script code.
 String scriptDisplayNameInContext(String script)
          Deprecated. This API is ICU internal only.
abstract  String variantDisplayName(String variant)
          Returns the display name of the provided variant.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocaleDisplayNames

protected LocaleDisplayNames()
Deprecated. This API is ICU internal only.

Sole constructor. (For invocation by subclass constructors, typically implicit.)

Status:
Internal. This API is ICU internal only.
Method Detail

getInstance

public static LocaleDisplayNames getInstance(ULocale locale)
Convenience overload of getInstance(ULocale, DialectHandling) that specifies STANDARD dialect handling.

Parameters:
locale - the display locale
Returns:
a LocaleDisplayNames instance
Status:
Stable ICU 4.4.

getInstance

public static LocaleDisplayNames getInstance(ULocale locale,
                                             LocaleDisplayNames.DialectHandling dialectHandling)
Returns an instance of LocaleDisplayNames that returns names formatted for the provided locale, using the provided dialectHandling.

Parameters:
locale - the display locale
dialectHandling - how to select names for locales
Returns:
a LocaleDisplayNames instance
Status:
Stable ICU 4.4.

getLocale

public abstract ULocale getLocale()
Returns the locale used to determine the display names. This is not necessarily the same locale passed to getInstance(com.ibm.icu.util.ULocale).

Returns:
the display locale
Status:
Stable ICU 4.4.

getDialectHandling

public abstract LocaleDisplayNames.DialectHandling getDialectHandling()
Returns the dialect handling used in the display names.

Returns:
the dialect handling enum
Status:
Stable ICU 4.4.

localeDisplayName

public abstract String localeDisplayName(ULocale locale)
Returns the display name of the provided ulocale.

Parameters:
locale - the locale whose display name to return
Returns:
the display name of the provided locale
Status:
Stable ICU 4.4.

localeDisplayName

public abstract String localeDisplayName(Locale locale)
Returns the display name of the provided locale.

Parameters:
locale - the locale whose display name to return
Returns:
the display name of the provided locale
Status:
Stable ICU 4.4.

localeDisplayName

public abstract String localeDisplayName(String localeId)
Returns the display name of the provided locale id.

Parameters:
localeId - the id of the locale whose display name to return
Returns:
the display name of the provided locale
Status:
Stable ICU 4.4.

languageDisplayName

public abstract String languageDisplayName(String lang)
Returns the display name of the provided language code.

Parameters:
lang - the language code
Returns:
the display name of the provided language code
Status:
Stable ICU 4.4.

scriptDisplayName

public abstract String scriptDisplayName(String script)
Returns the display name of the provided script code.

Parameters:
script - the script code
Returns:
the display name of the provided script code
Status:
Stable ICU 4.4.

scriptDisplayNameInContext

public String scriptDisplayNameInContext(String script)
Deprecated. This API is ICU internal only.

Returns the display name of the provided script code when used in the context of a full locale name.

Parameters:
script - the script code
Returns:
the display name of the provided script code
Status:
Internal. This API is ICU internal only.

scriptDisplayName

public abstract String scriptDisplayName(int scriptCode)
Returns the display name of the provided script code. See UScript for recognized script codes.

Parameters:
scriptCode - the script code number
Returns:
the display name of the provided script code
Status:
Stable ICU 4.4.

regionDisplayName

public abstract String regionDisplayName(String region)
Returns the display name of the provided region code.

Parameters:
region - the region code
Returns:
the display name of the provided region code
Status:
Stable ICU 4.4.

variantDisplayName

public abstract String variantDisplayName(String variant)
Returns the display name of the provided variant.

Parameters:
variant - the variant string
Returns:
the display name of the provided variant
Status:
Stable ICU 4.4.

keyDisplayName

public abstract String keyDisplayName(String key)
Returns the display name of the provided locale key.

Parameters:
key - the locale key name
Returns:
the display name of the provided locale key
Status:
Stable ICU 4.4.

keyValueDisplayName

public abstract String keyValueDisplayName(String key,
                                           String value)
Returns the display name of the provided value (used with the provided key).

Parameters:
key - the locale key name
value - the locale key's value
Returns:
the display name of the provided value
Status:
Stable ICU 4.4.


Copyright (c) 2011 IBM Corporation and others.