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

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

Wakes up a single thread that is waiting on this object's monitor.

final void notifyAll()

Wakes up all threads that are waiting on this object's monitor.

String toString()

Returns a string representation of the object.

final void wait(long timeoutMillis, int nanos)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait(long timeoutMillis)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait()

Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

Constants

ALT_QUOTATION_END

Added in API level 28
public static final int ALT_QUOTATION_END

Delimiter type for getDelimiter(int).

Constant Value: 3 (0x00000003)

ALT_QUOTATION_START

Added in API level 28
public static final int ALT_QUOTATION_START

Delimiter type for getDelimiter(int).

Constant Value: 2 (0x00000002)

QUOTATION_END

Added in API level 28
public static final int QUOTATION_END

Delimiter type for getDelimiter(int).

Constant Value: 1 (0x00000001)

QUOTATION_START

Added in API level 28
public static final int QUOTATION_START

Delimiter type for getDelimiter(int).

Constant Value: 0 (0x00000000)

Public methods

getCLDRVersion

Added in API level 28
public static VersionInfo getCLDRVersion ()

Returns the current CLDR version

Returns
VersionInfo

getDelimiter

Added in API level 28
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.

getInstance

Added in API level 28
public static 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

Added in API level 28
public static LocaleData getInstance ()

Gets the LocaleData object associated with the default FORMAT locale

Returns
LocaleData A locale data object.

getMeasurementSystem

Added in API level 28
public static 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

Added in API level 28
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.

getPaperSize

Added in API level 28
public static 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

Added in API level 28
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.