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 |
int |
ALT_QUOTATION_START
Delimiter type for |
int |
QUOTATION_END
Delimiter type for |
int |
QUOTATION_START
Delimiter type for |
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 |
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
public static final int ALT_QUOTATION_END
Delimiter type for getDelimiter(int)
.
Constant Value: 3 (0x00000003)
ALT_QUOTATION_START
public static final int ALT_QUOTATION_START
Delimiter type for getDelimiter(int)
.
Constant Value: 2 (0x00000002)
QUOTATION_END
public static final int QUOTATION_END
Delimiter type for getDelimiter(int)
.
Constant Value: 1 (0x00000001)
QUOTATION_START
public static final int QUOTATION_START
Delimiter type for getDelimiter(int)
.
Constant Value: 0 (0x00000000)
Public methods
getCLDRVersion
public static VersionInfo getCLDRVersion ()
Returns the current CLDR version
Returns | |
---|---|
VersionInfo |
getDelimiter
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
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
public static LocaleData getInstance ()
Gets the LocaleData object associated with the default FORMAT
locale
Returns | |
---|---|
LocaleData |
A locale data object. |
See also:
getMeasurementSystem
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
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
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
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. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2024-04-04 UTC.