Top Description Inners Fields Constructors Methods
com.ibm.icu.util

public final Class LocaleData

extends Object
Class Inheritance
Imports
java.util.MissingResourceException, com.ibm.icu.impl.ICUData, .ICUResourceBundle, com.ibm.icu.text.UnicodeSet, com.ibm.icu.util.ULocale.Category

A class for accessing miscellaneous data in the locale bundles
Author
ram
ICU Status
Stable since ICU 2.8.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
LocaleData.MeasurementSystem

Enumeration for representing the measurement systems.

public static class
LocaleData.PaperSize

A class that represents the size of letter head used in the country

Field Summary

Modifier and TypeField and Description
public static final int
public static final int
private ICUResourceBundle
public static final int
DELIMITER_COUNT

Count of delimiter types for getDelimiter(int).

private static final String[]
public static final int
public static final int
ES_COUNT

Count of EXTypes for getExemplarSet(int, int).

public static final int
public static final int
public static final int
public static final int
private static VersionInfo
private ICUResourceBundle
private MissingResourceException
private static final String
private static final String
private boolean
private static final String
private static final String
public static final int
QUOTATION_END

Delimiter type for getDelimiter(int).

public static final int
private static final String

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static VersionInfo
getCLDRVersion()

Returns the current CLDR version

public String

Returns:

The desired delimiter string.
getDelimiter
(int
The type of delimiter string desired. Currently, the valid choices are QUOTATION_START, QUOTATION_END, ALT_QUOTATION_START, or ALT_QUOTATION_END.
type
)

Retrieves a delimiter string from the locale data.

public static UnicodeSet

Returns:

The set of exemplar characters for the given locale.
getExemplarSet
(ULocale
Locale for which the exemplar character set is to be retrieved.
locale
,
int
Bitmask for options to apply to the exemplar pattern. Specify zero to retrieve the exemplar set as it is defined in the locale data. Specify UnicodeSet.CASE to retrieve a case-folded exemplar set. See UnicodeSet#applyPattern(String, int) for a complete list of valid options. The IGNORE_SPACE bit is always set, regardless of the value of 'options'.
options
)

Returns the set of exemplar characters for a locale.

public static UnicodeSet

Returns:

The set of exemplar characters for the given locale.
getExemplarSet
(ULocale
Locale for which the exemplar character set is to be retrieved.
locale
,
int
Bitmask for options to apply to the exemplar pattern. Specify zero to retrieve the exemplar set as it is defined in the locale data. Specify UnicodeSet.CASE to retrieve a case-folded exemplar set. See UnicodeSet#applyPattern(String, int) for a complete list of valid options. The IGNORE_SPACE bit is always set, regardless of the value of 'options'.
options
,
int
The type of exemplar character set to retrieve.
extype
)

Returns the set of exemplar characters for a locale.

public UnicodeSet

Returns:

The set of exemplar characters for the given locale. If there is nothing available for the locale, then null is returned if getNoSubstitute() is true, otherwise the root value is returned (which may be UnicodeSet.EMPTY).
getExemplarSet
(int
Bitmask for options to apply to the exemplar pattern. Specify zero to retrieve the exemplar set as it is defined in the locale data. Specify UnicodeSet.CASE to retrieve a case-folded exemplar set. See UnicodeSet#applyPattern(String, int) for a complete list of valid options. The IGNORE_SPACE bit is always set, regardless of the value of 'options'.
options
,
int
The type of exemplar set to be retrieved, ES_STANDARD, ES_INDEX, ES_AUXILIARY, or ES_PUNCTUATION
extype
)

Returns the set of exemplar characters for a locale.

public static final LocaleData

Returns:

A locale data object.
getInstance
(ULocale
Locale with thich the locale data object is associated.
locale
)

Gets the LocaleData object associated with the ULocale specified in locale

public static final LocaleData

Returns:

A locale data object.
getInstance
()

Gets the LocaleData object associated with the default FORMAT locale

public String

Returns:

locale display pattern as a String.
getLocaleDisplayPattern
()

Returns LocaleDisplayPattern for this locale, e.g., {0}({1})

public String

Returns:

locale display separator as a char.
getLocaleSeparator
()

Returns LocaleDisplaySeparator for this locale.

public static final LocaleData.MeasurementSystem

Returns:

MeasurementSystem the measurement system used in the locale.
getMeasurementSystem
(ULocale
The locale for which the measurement system to be retrieved.
locale
)

Returns the measurement system used in the locale specified by the locale.

public boolean

Returns:

Value for the no substitute behavior. If true, methods of this locale data object will return an error when no data is available for that method, given the locale ID supplied to the constructor.
getNoSubstitute
()

Gets the "no substitute" behavior of this locale data object.

public static final LocaleData.PaperSize

Returns:

The paper size used in the locale
getPaperSize
(ULocale
The locale for which the measurement system to be retrieved.
locale
)

Returns the size of paper used in the locale.

private static UResourceBundle
measurementTypeBundleForLocale(ULocale locale, String measurementType)

Utility for getMeasurementSystem and getPaperSize

public void
setNoSubstitute(boolean
Value for the no substitute behavior. If true, methods of this locale data object will return an error when no data is available for that method, given the locale ID supplied to the constructor.
setting
)

Sets the "no substitute" behavior of this locale data object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ALT_QUOTATION_ENDback to summary
public static final int ALT_QUOTATION_END

Delimiter type for getDelimiter(int).

ICU Status
Stable since ICU 3.4.
ALT_QUOTATION_STARTback to summary
public static final int ALT_QUOTATION_START

Delimiter type for getDelimiter(int).

ICU Status
Stable since ICU 3.4.
bundleback to summary
private ICUResourceBundle bundle
DELIMITER_COUNTback to summary
public static final int DELIMITER_COUNT

Deprecated

ICU 58 The numeric value may change over time, see ICU ticket #12420.

Count of delimiter types for getDelimiter(int).

Annotations
@Deprecated
DELIMITER_TYPESback to summary
private static final String[] DELIMITER_TYPES
ES_AUXILIARYback to summary
public static final int ES_AUXILIARY

EXType for getExemplarSet(int, int). Corresponds to the 'auxiliary' CLDR exemplars in http://www.unicode.org/reports/tr35/tr35-general.html#Character_Elements.

ICU Status
Stable since ICU 3.4.
ES_COUNTback to summary
public static final int ES_COUNT

Deprecated

ICU 58 The numeric value may change over time, see ICU ticket #12420.

Count of EXTypes for getExemplarSet(int, int).

Annotations
@Deprecated
ES_CURRENCYback to summary
public static final int ES_CURRENCY

Deprecated

ICU 51

EXType for getExemplarSet(int, int). Corresponds to the 'currencySymbol' CLDR exemplars in http://www.unicode.org/reports/tr35/tr35-general.html#Character_Elements.

Note

This type is no longer supported.

Annotations
@Deprecated
ES_INDEXback to summary
public static final int ES_INDEX

EXType for getExemplarSet(int, int). Corresponds to the 'index' CLDR exemplars in http://www.unicode.org/reports/tr35/tr35-general.html#Character_Elements.

ICU Status
Stable since ICU 4.4.
ES_PUNCTUATIONback to summary
public static final int ES_PUNCTUATION

Corresponds to the 'punctuation' CLDR exemplars in http://www.unicode.org/reports/tr35/tr35-general.html#Character_Elements. EXType for getExemplarSet(int, int).

ICU Status
Stable since ICU 49.
ES_STANDARDback to summary
public static final int ES_STANDARD

EXType for getExemplarSet(int, int). Corresponds to the 'main' (aka 'standard') CLDR exemplars in http://www.unicode.org/reports/tr35/tr35-general.html#Character_Elements.

ICU Status
Stable since ICU 3.4.
gCLDRVersionback to summary
private static VersionInfo gCLDRVersion
langBundleback to summary
private ICUResourceBundle langBundle
langBundleExceptionback to summary
private MissingResourceException langBundleException
LOCALE_DISPLAY_PATTERNback to summary
private static final String LOCALE_DISPLAY_PATTERN
MEASUREMENT_SYSTEMback to summary
private static final String MEASUREMENT_SYSTEM
noSubstituteback to summary
private boolean noSubstitute
PAPER_SIZEback to summary
private static final String PAPER_SIZE
PATTERNback to summary
private static final String PATTERN
QUOTATION_ENDback to summary
public static final int QUOTATION_END

Delimiter type for getDelimiter(int).

ICU Status
Stable since ICU 3.4.
QUOTATION_STARTback to summary
public static final int QUOTATION_START

Delimiter type for getDelimiter(int).

ICU Status
Stable since ICU 3.4.
SEPARATORback to summary
private static final String SEPARATOR

Constructor Detail

LocaleDataback to summary
private LocaleData()

Method Detail

getCLDRVersionback to summary
public static VersionInfo getCLDRVersion()

Returns the current CLDR version

ICU Status
Stable since ICU 4.2.
getDelimiterback to summary
public String getDelimiter(int type)

Retrieves a delimiter string from the locale data.

Parameters
type:int

The type of delimiter string desired. Currently, the valid choices are QUOTATION_START, QUOTATION_END, ALT_QUOTATION_START, or ALT_QUOTATION_END.

Returns:String

The desired delimiter string.

ICU Status
Stable since ICU 3.4.
getExemplarSetback to summary
public static UnicodeSet getExemplarSet(ULocale locale, int options)

Returns the set of exemplar characters for a locale. Equivalent to calling getExemplarSet(ULocale, int, int) with the extype == ES_STANDARD.

Parameters
locale:ULocale

Locale for which the exemplar character set is to be retrieved.

options:int

Bitmask for options to apply to the exemplar pattern. Specify zero to retrieve the exemplar set as it is defined in the locale data. Specify UnicodeSet.CASE to retrieve a case-folded exemplar set. See UnicodeSet#applyPattern(String, int) for a complete list of valid options. The IGNORE_SPACE bit is always set, regardless of the value of 'options'.

Returns:UnicodeSet

The set of exemplar characters for the given locale.

ICU Status
Stable since ICU 3.0.
getExemplarSetback to summary
public static UnicodeSet getExemplarSet(ULocale locale, int options, int extype)

Returns the set of exemplar characters for a locale. Equivalent to calling new LocaleData(locale).getExemplarSet(int, int).

Parameters
locale:ULocale

Locale for which the exemplar character set is to be retrieved.

options:int

Bitmask for options to apply to the exemplar pattern. Specify zero to retrieve the exemplar set as it is defined in the locale data. Specify UnicodeSet.CASE to retrieve a case-folded exemplar set. See UnicodeSet#applyPattern(String, int) for a complete list of valid options. The IGNORE_SPACE bit is always set, regardless of the value of 'options'.

extype:int

The type of exemplar character set to retrieve.

Returns:UnicodeSet

The set of exemplar characters for the given locale.

ICU Status
Stable since ICU 3.0.
getExemplarSetback to summary
public UnicodeSet getExemplarSet(int options, int extype)

Returns the set of exemplar characters for a locale.

Parameters
options:int

Bitmask for options to apply to the exemplar pattern. Specify zero to retrieve the exemplar set as it is defined in the locale data. Specify UnicodeSet.CASE to retrieve a case-folded exemplar set. See UnicodeSet#applyPattern(String, int) for a complete list of valid options. The IGNORE_SPACE bit is always set, regardless of the value of 'options'.

extype:int

The type of exemplar set to be retrieved, ES_STANDARD, ES_INDEX, ES_AUXILIARY, or ES_PUNCTUATION

Returns:UnicodeSet

The set of exemplar characters for the given locale. If there is nothing available for the locale, then null is returned if getNoSubstitute() is true, otherwise the root value is returned (which may be UnicodeSet.EMPTY).

Exceptions
RuntimeException:
if the extype is invalid.
ICU Status
Stable since ICU 3.4.
getInstanceback to summary
public static final LocaleData getInstance(ULocale locale)

Gets the LocaleData object associated with the ULocale specified in locale

Parameters
locale:ULocale

Locale with thich the locale data object is associated.

Returns:LocaleData

A locale data object.

ICU Status
Stable since ICU 3.4.
getInstanceback to summary
public static final LocaleData getInstance()

Gets the LocaleData object associated with the default FORMAT locale

Returns:LocaleData

A locale data object.

ICU Status
Stable since ICU 3.4.
See Also
Category#FORMAT
getLocaleDisplayPatternback to summary
public String getLocaleDisplayPattern()

Returns LocaleDisplayPattern for this locale, e.g., {0}({1})

Returns:String

locale display pattern as a String.

ICU Status
Stable since ICU 4.2.
getLocaleSeparatorback to summary
public String getLocaleSeparator()

Returns LocaleDisplaySeparator for this locale.

Returns:String

locale display separator as a char.

ICU Status
Stable since ICU 4.2.
getMeasurementSystemback to summary
public static final LocaleData.MeasurementSystem getMeasurementSystem(ULocale locale)

Returns the measurement system used in the locale specified by the locale.

Parameters
locale:ULocale

The locale for which the measurement system to be retrieved.

Returns:LocaleData.MeasurementSystem

MeasurementSystem the measurement system used in the locale.

ICU Status
Stable since ICU 3.0.
getNoSubstituteback to summary
public boolean getNoSubstitute()

Gets the "no substitute" behavior of this locale data object.

Returns:boolean

Value for the no substitute behavior. If true, methods of this locale data object will return an error when no data is available for that method, given the locale ID supplied to the constructor.

ICU Status
Stable since ICU 3.4.
getPaperSizeback to summary
public static final LocaleData.PaperSize getPaperSize(ULocale locale)

Returns the size of paper used in the locale. The paper sizes returned are always in milli-meters.

Parameters
locale:ULocale

The locale for which the measurement system to be retrieved.

Returns:LocaleData.PaperSize

The paper size used in the locale

ICU Status
Stable since ICU 3.0.
measurementTypeBundleForLocaleback to summary
private static UResourceBundle measurementTypeBundleForLocale(ULocale locale, String measurementType)

Utility for getMeasurementSystem and getPaperSize

setNoSubstituteback to summary
public void setNoSubstitute(boolean setting)

Sets the "no substitute" behavior of this locale data object.

Parameters
setting:boolean

Value for the no substitute behavior. If true, methods of this locale data object will return an error when no data is available for that method, given the locale ID supplied to the constructor.

ICU Status
Stable since ICU 3.4.
com.ibm.icu.util back to summary

public final Class LocaleData.MeasurementSystem

extends Object
Class Inheritance

Enumeration for representing the measurement systems.
ICU Status
Stable since ICU 2.8.

Field Summary

Modifier and TypeField and Description
public static final LocaleData.MeasurementSystem
SI

Measurement system specified by Le Système International d'Unités (SI) otherwise known as Metric system.

public static final LocaleData.MeasurementSystem
UK

Mix of metric and imperial units used in Great Britain.

public static final LocaleData.MeasurementSystem
US

Measurement system followed in the United States of America.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

SIback to summary
public static final LocaleData.MeasurementSystem SI

Measurement system specified by Le Système International d'Unités (SI) otherwise known as Metric system.

ICU Status
Stable since ICU 2.8.
UKback to summary
public static final LocaleData.MeasurementSystem UK

Mix of metric and imperial units used in Great Britain.

ICU Status
Stable since ICU 55.
USback to summary
public static final LocaleData.MeasurementSystem US

Measurement system followed in the United States of America.

ICU Status
Stable since ICU 2.8.

Constructor Detail

MeasurementSystemback to summary
private MeasurementSystem()
com.ibm.icu.util back to summary

public final Class LocaleData.PaperSize

extends Object
Class Inheritance

A class that represents the size of letter head used in the country
ICU Status
Stable since ICU 2.8.

Field Summary

Modifier and TypeField and Description
private int
private int

Constructor Summary

AccessConstructor and Description
private
PaperSize(int h, int w)

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the height
getHeight
()

Returns the height of the paper

public int

Returns:

the width
getWidth
()

Returns the width of the paper

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

heightback to summary
private int height
widthback to summary
private int width

Constructor Detail

PaperSizeback to summary
private PaperSize(int h, int w)

Method Detail

getHeightback to summary
public int getHeight()

Returns the height of the paper

Returns:int

the height

ICU Status
Stable since ICU 2.8.
getWidthback to summary
public int getWidth()

Returns the width of the paper

Returns:int

the width

ICU Status
Stable since ICU 2.8.