Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
com.ibm.icu.util.GlobalizationPreferences
Field Summary | |
static int |
|
static int |
|
static int |
|
static int |
|
static int |
|
static int |
|
static int |
|
static int |
|
static int |
|
static int |
|
static int |
|
static int |
|
static int |
|
static int |
|
static int |
|
static int |
|
static int |
|
static int |
|
Method Summary | |
Object |
|
Object |
|
Calendar |
|
Collator |
|
Currency |
|
DateFormat |
|
ULocale |
|
String |
|
ULocale |
|
List |
|
NumberFormat |
|
ULocale |
|
String |
|
TimeZone |
|
protected Calendar |
|
protected Collator |
|
protected Currency |
|
protected List |
|
protected String |
|
protected TimeZone |
|
boolean |
|
GlobalizationPreferences |
|
GlobalizationPreferences |
|
GlobalizationPreferences |
|
GlobalizationPreferences |
|
GlobalizationPreferences |
|
GlobalizationPreferences |
|
GlobalizationPreferences |
|
GlobalizationPreferences | |
GlobalizationPreferences |
|
GlobalizationPreferences |
|
GlobalizationPreferences |
|
GlobalizationPreferences |
|
GlobalizationPreferences |
|
GlobalizationPreferences |
|
GlobalizationPreferences |
|
GlobalizationPreferences |
|
public static final int CURRENCY
Deprecated. This API is ICU internal only.
Number Format types
- Field Value:
- 0
public static final int CURRENCYID
Deprecated. This API is ICU internal only.
For selecting a choice of display names
- Field Value:
- 7
public static final int CURRENCY_SYMBOLID
Deprecated. This API is ICU internal only.
For selecting a choice of display names
- Field Value:
- 8
public static final int DISPLAYID_LIMIT
Deprecated. This API is ICU internal only.
For selecting a choice of display names
- Field Value:
- 10
public static final int INTEGER
Deprecated. This API is ICU internal only.
Number Format types
- Field Value:
- 2
public static final int KEYWORDID
Deprecated. This API is ICU internal only.
For selecting a choice of display names
- Field Value:
- 5
public static final int KEYWORD_VALUEID
Deprecated. This API is ICU internal only.
For selecting a choice of display names
- Field Value:
- 6
public static final int LANGUAGEID
Deprecated. This API is ICU internal only.
For selecting a choice of display names
- Field Value:
- 1
public static final int LOCALEID
Deprecated. This API is ICU internal only.
For selecting a choice of display names
- Field Value:
- 0
public static final int NONE
Deprecated. This API is ICU internal only.
Supplement to DateFormat.FULL, LONG, MEDIUM, SHORT. Indicates that no value for one of date or time is to be used.
- Field Value:
- 4
public static final int NUMBER
Deprecated. This API is ICU internal only.
Number Format types
- Field Value:
- 1
public static final int NUMBER_LIMIT
Deprecated. This API is ICU internal only.
Number Format types
- Field Value:
- 5
public static final int PERCENT
Deprecated. This API is ICU internal only.
Number Format types
- Field Value:
- 4
public static final int SCIENTIFIC
Deprecated. This API is ICU internal only.
Number Format types
- Field Value:
- 3
public static final int SCRIPTID
Deprecated. This API is ICU internal only.
For selecting a choice of display names
- Field Value:
- 2
public static final int TERRITORYID
Deprecated. This API is ICU internal only.
For selecting a choice of display names
- Field Value:
- 3
public static final int TIMEZONEID
Deprecated. This API is ICU internal only.
For selecting a choice of display names
- Field Value:
- 9
public static final int VARIANTID
Deprecated. This API is ICU internal only.
For selecting a choice of display names
- Field Value:
- 4
public Object cloneAsThawed()
Deprecated. This API is ICU internal only.
- Specified by:
- cloneAsThawed in interface Freezable
public Object freeze()
Deprecated. This API is ICU internal only.
public Calendar getCalendar()
Deprecated. This API is ICU internal only.
Get a copy of the calendar according to the settings.
- Returns:
- calendar explicit or implicit.
public Collator getCollator()
Deprecated. This API is ICU internal only.
Get a copy of the collator according to the settings.
- Returns:
- collator explicit or implicit.
public Currency getCurrency()
Deprecated. This API is ICU internal only.
Get a copy of the currency computed according to the settings.
- Returns:
- currency code, explicit or implicit.
public DateFormat getDateFormat(int dateStyle, int timeStyle)
Deprecated. This API is ICU internal only.
Gets a date format according to the current settings. If there is an explicit (non-null) date/time format set, a copy of that is returned. Otherwise, if there is a non-null date locale, that is used. Otherwise, the language priority list is used. NONE should be used for the style, where only the date or time format individually is being gotten.
- Parameters:
dateStyle
- NONE, or DateFormat.FULL, LONG, MEDIUM, SHORTtimeStyle
- NONE, or DateFormat.FULL, LONG, MEDIUM, SHORT
- Returns:
- a DateFormat, according to the above description
public ULocale getDateLocale()
Deprecated. This API is ICU internal only.
Gets the date locale, to be used in computing date formats. Overrides the general locale setting.
- Returns:
- date locale. Null if none was set explicitly.
public String getDisplayName(String id, int type)
Deprecated. This API is ICU internal only.
Get the display name for an ID: language, script, territory, currency, timezone... Uses the language priority list to do so.
- Parameters:
id
- language code, script code, ...type
- specifies the type of the ID: LANGUAGE, etc.
- Returns:
- the display name
public ULocale getLocale(int index)
Deprecated. This API is ICU internal only.
Convenience function for getting the locales in priority order
- Parameters:
index
- The index (0..n) of the desired item.
- Returns:
- desired item.
public List getLocales()
Deprecated. This API is ICU internal only.
Get a copy of the language/locale priority list
- Returns:
- a copy of the language/locale priority list.
public NumberFormat getNumberFormat(int style)
Deprecated. This API is ICU internal only.
Gets a number format according to the current settings. If there is an explicit (non-null) number format set, a copy of that is returned. Otherwise, if there is a non-null number locale, that is used. Otherwise, the language priority list is used. NONE should be used for the style, where only the date or time format individually is being gotten.
- Parameters:
style
- CURRENCY, NUMBER, INTEGER, SCIENTIFIC, PERCENT
public ULocale getNumberLocale()
Deprecated. This API is ICU internal only.
Get the current number locale setting used for getNumberFormat.
- Returns:
- number locale. Null if none was set explicitly.
public String getTerritory()
Deprecated. This API is ICU internal only.
Gets the territory setting. If it wasn't explicitly set, it is computed from the general locale setting.
- Returns:
- territory code, explicit or implicit.
public TimeZone getTimeZone()
Deprecated. This API is ICU internal only.
Get the timezone. It was either explicitly set, or is heuristically computed from other settings.
- Returns:
- timezone, either implicitly or explicitly set
protected Calendar guessCalendar()
Deprecated. This API is ICU internal only.
This function can be overridden by subclasses to use different heuristics. It MUST return a 'safe' value, one whose modification will not affect this object.
protected Collator guessCollator()
Deprecated. This API is ICU internal only.
This function can be overridden by subclasses to use different heuristics. It MUST return a 'safe' value, one whose modification will not affect this object.
protected Currency guessCurrency()
Deprecated. This API is ICU internal only.
This function can be overridden by subclasses to use different heuristics
protected List guessLocales()
Deprecated. This API is ICU internal only.
This function can be overridden by subclasses to use different heuristics It MUST return a 'safe' value, one whose modification will not affect this object.
protected String guessTerritory()
Deprecated. This API is ICU internal only.
This function can be overridden by subclasses to use different heuristics.
protected TimeZone guessTimeZone()
Deprecated. This API is ICU internal only.
This function can be overridden by subclasses to use different heuristics. It MUST return a 'safe' value, one whose modification will not affect this object.
public boolean isFrozen()
Deprecated. This API is ICU internal only.
public GlobalizationPreferences reset()
Deprecated. This API is ICU internal only.
Restore the object to the initial state.
- Returns:
- this, for chaining
public GlobalizationPreferences setCalendar(Calendar calendar)
Deprecated. This API is ICU internal only.
Sets the calendar. If this has not been set, uses default for territory.
- Parameters:
calendar
- arbitrary calendar
- Returns:
- this, for chaining
public GlobalizationPreferences setCollator(Collator collator)
Deprecated. This API is ICU internal only.
Explicitly set the collator for this object.
- Parameters:
collator
-
- Returns:
- this, for chaining
public GlobalizationPreferences setCurrency(Currency currency)
Deprecated. This API is ICU internal only.
Sets the currency code. If this has not been set, uses default for territory.
- Parameters:
currency
- Valid ISO 4217 currency code.
- Returns:
- this, for chaining
public GlobalizationPreferences setDateFormat(int dateStyle, int timeStyle, String formatPattern)
Deprecated. This API is ICU internal only.
Set an explicit date format. Overrides both the date locale, and the locale priority list for a particular combination of dateStyle and timeStyle. NONE should be used if for the style, where only the date or time format individually is being set.
- Parameters:
dateStyle
- NONE, or DateFormat.FULL, LONG, MEDIUM, SHORTtimeStyle
- NONE, or DateFormat.FULL, LONG, MEDIUM, SHORTformatPattern
- date pattern, eg "yyyy-MMM-dd"
- Returns:
- this, for chaining
public GlobalizationPreferences setDateFormat(int dateStyle, int timeStyle, DateFormat format)
Deprecated. This API is ICU internal only.
Set an explicit date format. Overrides both the date locale, and the locale priority list for a particular combination of dateStyle and timeStyle. NONE should be used if for the style, where only the date or time format individually is being set.
- Parameters:
dateStyle
- NONE, or DateFormat.FULL, LONG, MEDIUM, SHORTtimeStyle
- NONE, or DateFormat.FULL, LONG, MEDIUM, SHORTformat
-
- Returns:
- this, for chaining
public GlobalizationPreferences setDateLocale(ULocale dateLocale)
Set the date locale.
- Parameters:
dateLocale
- If not null, overrides the locale priority list for all the date formats.
- Returns:
- this, for chaining
public GlobalizationPreferences setLocale(ULocale uLocale)
Deprecated. This API is ICU internal only.
Convenience routine for setting the language/locale priority list from a single locale/language.
- Parameters:
uLocale
- single locale
- Returns:
- this, for chaining
- See Also:
setLocales(List locales)
public GlobalizationPreferences setLocales(List locales)
Deprecated. This API is ICU internal only.
Sets the language/locale priority list. If other information is not (yet) available, this is used to to produce a default value for the appropriate territory, currency, timezone, etc. The user should be given the opportunity to correct those defaults in case they are incorrect.
- Parameters:
locales
- list of locales in priority order, eg {"be", "fr"} for Breton first, then French if that fails.
- Returns:
- this, for chaining
public GlobalizationPreferences setLocales(String acceptLanguageString)
Deprecated. This API is ICU internal only.
Convenience routine for setting the locale priority list from an Accept-Language string.
- Parameters:
acceptLanguageString
- Accept-Language list, as defined by Section 14.4 of the RFC 2616 (HTTP 1.1)
- Returns:
- this, for chaining
- See Also:
setLocales(List locales)
public GlobalizationPreferences setLocales(ULocale[] uLocales)
Deprecated. This API is ICU internal only.
Convenience routine for setting the language/locale priority list from an array.
- Parameters:
uLocales
- list of locales in an array
- Returns:
- this, for chaining
- See Also:
setLocales(List locales)
public GlobalizationPreferences setNumberFormat(int style, String formatPattern)
Deprecated. This API is ICU internal only.
Sets a number format explicitly. Overrides the number locale and the general locale settings.
- Returns:
- this, for chaining
public GlobalizationPreferences setNumberFormat(int style, DateFormat format)
Deprecated. This API is ICU internal only.
Sets a number format explicitly. Overrides the number locale and the general locale settings.
- Parameters:
style
- CURRENCY, NUMBER, INTEGER, SCIENTIFIC, PERCENT
- Returns:
- this, for chaining
public GlobalizationPreferences setNumberLocale(ULocale numberLocale)
Deprecated. This API is ICU internal only.
Set the number locale.
- Parameters:
numberLocale
- If not null, overrides the locale priority list for all the date formats.
- Returns:
- this, for chaining
public GlobalizationPreferences setTerritory(String territory)
Deprecated. This API is ICU internal only.
Sets the territory, which is a valid territory according to for RFC 3066 (or successor). If not otherwise set, default currency and timezone values will be set from this. The user should be given the opportunity to correct those defaults in case they are incorrect.
- Parameters:
territory
- code
- Returns:
- this, for chaining
public GlobalizationPreferences setTimeZone(TimeZone timezone)
Deprecated. This API is ICU internal only.
Sets the timezone ID. If this has not been set, uses default for territory.
- Parameters:
timezone
- a valid TZID (see UTS#35).
- Returns:
- this, for chaining