LocaleData

public final class LocaleData
extends Object

java.lang.Object
   ↳ android.icu.util.LocaleData


A class for accessing miscellaneous data in the locale bundles

Summary

Nested classes

class LocaleData.MeasurementSystem

Enumeration for representing the measurement systems. 

class LocaleData.PaperSize

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

Constants

int ALT_QUOTATION_END

Delimiter type for getDelimiter(int).

int ALT_QUOTATION_START

Delimiter type for getDelimiter(int).

int QUOTATION_END

Delimiter type for getDelimiter(int).

int QUOTATION_START

Delimiter type for getDelimiter(int).

Public methods

static VersionInfo getCLDRVersion()

Returns the current CLDR version

String getDelimiter(int type)

Retrieves a delimiter string from the locale data.

static LocaleData getInstance(ULocale locale)

Gets the LocaleData object associated with the ULocale specified in locale

static LocaleData getInstance()

Gets the LocaleData object associated with the default FORMAT locale

static LocaleData.MeasurementSystem getMeasurementSystem(ULocale locale)

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

boolean getNoSubstitute()

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

static 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.

Inherited methods

Constants

ALT_QUOTATION_END

int ALT_QUOTATION_END

Delimiter type for getDelimiter(int).

Constant Value: 3 (0x00000003)

ALT_QUOTATION_START

int ALT_QUOTATION_START

Delimiter type for getDelimiter(int).

Constant Value: 2 (0x00000002)

QUOTATION_END

int QUOTATION_END

Delimiter type for getDelimiter(int).

Constant Value: 1 (0x00000001)

QUOTATION_START

int QUOTATION_START

Delimiter type for getDelimiter(int).

Constant Value: 0 (0x00000000)

Public methods

getCLDRVersion

VersionInfo getCLDRVersion ()

Returns the current CLDR version

Returns
VersionInfo

getDelimiter

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.

getInstance

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.

getInstance

LocaleData getInstance ()

Gets the LocaleData object associated with the default FORMAT locale

Returns
LocaleData A locale data object.

See also:

getMeasurementSystem

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.

getNoSubstitute

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.

getPaperSize

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

setNoSubstitute

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.