Package com.ibm.icu.util
Class LocaleData
java.lang.Object
com.ibm.icu.util.LocaleData
A class for accessing miscellaneous data in the locale bundles
- Author:
- ram
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Enumeration for representing the measurement systems.static final class
A class that represents the size of letter head used in the country -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Delimiter type forgetDelimiter(int)
.static final int
Delimiter type forgetDelimiter(int)
.static final int
Deprecated.ICU 58 The numeric value may change over time, see ICU ticket #12420.static final int
EXType forgetExemplarSet(int, int)
.static final int
Deprecated.ICU 58 The numeric value may change over time, see ICU ticket #12420.static final int
Deprecated.ICU 51static final int
EXType forgetExemplarSet(int, int)
.static final int
Corresponds to the 'punctuation' CLDR exemplars in http://www.unicode.org/reports/tr35/tr35-general.html#Character_Elements.static final int
EXType forgetExemplarSet(int, int)
.static final int
Delimiter type forgetDelimiter(int)
.static final int
Delimiter type forgetDelimiter(int)
. -
Method Summary
Modifier and TypeMethodDescriptionstatic VersionInfo
Returns the current CLDR versiongetDelimiter
(int type) Retrieves a delimiter string from the locale data.getExemplarSet
(int options, int extype) Returns the set of exemplar characters for a locale.static UnicodeSet
getExemplarSet
(ULocale locale, int options) Returns the set of exemplar characters for a locale.static UnicodeSet
getExemplarSet
(ULocale locale, int options, int extype) Returns the set of exemplar characters for a locale.static final LocaleData
Gets the LocaleData object associated with the defaultFORMAT
localestatic final LocaleData
getInstance
(ULocale locale) Gets the LocaleData object associated with the ULocale specified in localeReturns LocaleDisplayPattern for this locale, e.g., {0}({1})Returns LocaleDisplaySeparator for this locale.static final LocaleData.MeasurementSystem
getMeasurementSystem
(ULocale locale) Returns the measurement system used in the locale specified by the locale.boolean
Gets the "no substitute" behavior of this locale data object.static final LocaleData.PaperSize
getPaperSize
(ULocale locale) Returns the size of paper used in the locale.void
setNoSubstitute
(boolean setting) Sets the "no substitute" behavior of this locale data object.
-
Field Details
-
ES_STANDARD
public static final int ES_STANDARDEXType forgetExemplarSet(int, int)
. Corresponds to the 'main' (aka 'standard') CLDR exemplars in http://www.unicode.org/reports/tr35/tr35-general.html#Character_Elements.- See Also:
-
ES_AUXILIARY
public static final int ES_AUXILIARYEXType forgetExemplarSet(int, int)
. Corresponds to the 'auxiliary' CLDR exemplars in http://www.unicode.org/reports/tr35/tr35-general.html#Character_Elements.- See Also:
-
ES_INDEX
public static final int ES_INDEXEXType forgetExemplarSet(int, int)
. Corresponds to the 'index' CLDR exemplars in http://www.unicode.org/reports/tr35/tr35-general.html#Character_Elements.- See Also:
-
ES_CURRENCY
Deprecated.ICU 51EXType forgetExemplarSet(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.- See Also:
-
ES_PUNCTUATION
public static final int ES_PUNCTUATIONCorresponds to the 'punctuation' CLDR exemplars in http://www.unicode.org/reports/tr35/tr35-general.html#Character_Elements. EXType forgetExemplarSet(int, int)
.- See Also:
-
ES_COUNT
Deprecated.ICU 58 The numeric value may change over time, see ICU ticket #12420.Count of EXTypes forgetExemplarSet(int, int)
.- See Also:
-
QUOTATION_START
public static final int QUOTATION_STARTDelimiter type forgetDelimiter(int)
.- See Also:
-
QUOTATION_END
public static final int QUOTATION_ENDDelimiter type forgetDelimiter(int)
.- See Also:
-
ALT_QUOTATION_START
public static final int ALT_QUOTATION_STARTDelimiter type forgetDelimiter(int)
.- See Also:
-
ALT_QUOTATION_END
public static final int ALT_QUOTATION_ENDDelimiter type forgetDelimiter(int)
.- See Also:
-
DELIMITER_COUNT
Deprecated.ICU 58 The numeric value may change over time, see ICU ticket #12420.Count of delimiter types forgetDelimiter(int)
.- See Also:
-
-
Method Details
-
getExemplarSet
Returns the set of exemplar characters for a locale. Equivalent to callinggetExemplarSet(ULocale, int, int)
with the extype ==ES_STANDARD
.- Parameters:
locale
- Locale for which the exemplar character set is to be retrieved.options
- 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. SeeUnicodeSet.applyPattern(String, int)
for a complete list of valid options. The IGNORE_SPACE bit is always set, regardless of the value of 'options'.- Returns:
- The set of exemplar characters for the given locale.
-
getExemplarSet
Returns the set of exemplar characters for a locale. Equivalent to calling new LocaleData(locale).getExemplarSet(int, int)
.- Parameters:
locale
- Locale for which the exemplar character set is to be retrieved.options
- 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. SeeUnicodeSet.applyPattern(String, int)
for a complete list of valid options. The IGNORE_SPACE bit is always set, regardless of the value of 'options'.extype
- The type of exemplar character set to retrieve.- Returns:
- The set of exemplar characters for the given locale.
-
getExemplarSet
Returns the set of exemplar characters for a locale.- Parameters:
options
- 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. SeeUnicodeSet.applyPattern(String, int)
for a complete list of valid options. The IGNORE_SPACE bit is always set, regardless of the value of 'options'.extype
- The type of exemplar set to be retrieved, ES_STANDARD, ES_INDEX, ES_AUXILIARY, or ES_PUNCTUATION- 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). - Throws:
RuntimeException
- if the extype is invalid.
-
getInstance
Gets the LocaleData object associated with the ULocale specified in locale- Parameters:
locale
- Locale with thich the locale data object is associated.- Returns:
- A locale data object.
-
getInstance
Gets the LocaleData object associated with the defaultFORMAT
locale- Returns:
- A locale data object.
- See Also:
-
setNoSubstitute
public void setNoSubstitute(boolean setting) Sets the "no substitute" behavior of this locale data object.- Parameters:
setting
- 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
public boolean getNoSubstitute()Gets the "no substitute" behavior of this locale data object.- 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.
-
getDelimiter
Retrieves a delimiter string from the locale data.- Parameters:
type
- The type of delimiter string desired. Currently, the valid choices are QUOTATION_START, QUOTATION_END, ALT_QUOTATION_START, or ALT_QUOTATION_END.- Returns:
- The desired delimiter string.
-
getMeasurementSystem
Returns the measurement system used in the locale specified by the locale.- Parameters:
locale
- The locale for which the measurement system to be retrieved.- Returns:
- MeasurementSystem the measurement system used in the locale.
-
getPaperSize
Returns the size of paper used in the locale. The paper sizes returned are always in milli-meters.- Parameters:
locale
- The locale for which the measurement system to be retrieved.- Returns:
- The paper size used in the locale
-
getLocaleDisplayPattern
Returns LocaleDisplayPattern for this locale, e.g., {0}({1})- Returns:
- locale display pattern as a String.
-
getLocaleSeparator
Returns LocaleDisplaySeparator for this locale.- Returns:
- locale display separator as a char.
-
getCLDRVersion
Returns the current CLDR version
-