Top Description Inners Fields Constructors Methods
com.ibm.icu.text

public abstract Class UFormat

extends Format
Class Inheritance
Known Direct Subclasses
com.ibm.icu.text.DurationFormat, com.ibm.icu.text.MeasureFormat, com.ibm.icu.text.MessageFormat, com.ibm.icu.text.TimeZoneFormat, com.ibm.icu.text.DateFormat, com.ibm.icu.text.DateIntervalFormat, com.ibm.icu.text.NumberFormat, com.ibm.icu.text.PluralFormat
Imports
java.text.Format, com.ibm.icu.util.ULocale

An abstract class that extends java.text.Format to provide additional ICU protocol, specifically, the getLocale() API. All ICU format classes are subclasses of this class.
Authors
weiv, Alan Liu
ICU Status
Stable since ICU 2.8.
See Also
com.ibm.icu.util.ULocale

Nested and Inner Type Summary

Modifier and TypeClass and Description
public abstract static class
UFormat.SpanField

A field that represents a span of text that may be composed with other fields.

Field Summary

Modifier and TypeField and Description
private ULocale
actualLocale

The locale containing data used to construct this object, or null.

private static final long
private ULocale
validLocale

The most specific locale containing any resource data, or null.

Constructor Summary

AccessConstructor and Description
public
UFormat()

Default constructor.

Method Summary

Modifier and TypeMethod and Description
public final ULocale

Returns:

the information specified by type, or null if this object was not constructed from locale data.
getLocale
(ULocale.Type type)

Return the locale that was used to create this object, or null.

pack-priv final void
setLocale(ULocale
the most specific locale containing any resource data, or null
valid
,
ULocale
the locale containing data used to construct this object, or null
actual
)

Set information about the locales that were used to create this object.

Inherited from java.text.Format:
cloneformatformatformatToCharacterIteratorparseObjectparseObject

Field Detail

actualLocaleback to summary
private ULocale actualLocale

The locale containing data used to construct this object, or null.

See Also
com.ibm.icu.util.ULocale
serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.text.Format.serialVersionUID.

validLocaleback to summary
private ULocale validLocale

The most specific locale containing any resource data, or null.

See Also
com.ibm.icu.util.ULocale

Constructor Detail

UFormatback to summary
public UFormat()

Default constructor.

ICU Status
Stable since ICU 2.8.

Method Detail

getLocaleback to summary
public final ULocale getLocale(ULocale.Type type)

Return the locale that was used to create this object, or null. This may may differ from the locale requested at the time of this object's creation. For example, if an object is created for locale en_US_CALIFORNIA, the actual data may be drawn from en (the actual locale), and en_US may be the most specific locale that exists (the valid locale).

Note

This method will be implemented in ICU 3.0; ICU 2.8 contains a partial preview implementation. The actual locale is returned correctly, but the valid locale is not, in most cases.

Parameters
type:ULocale.Type

type of information requested, either com.ibm.icu.util.ULocale#VALID_LOCALE or com.ibm.icu.util.ULocale#ACTUAL_LOCALE.

Returns:ULocale

the information specified by type, or null if this object was not constructed from locale data.

ICU Status
Draft since ICU 2.8 (retain).
See Also
com.ibm.icu.util.ULocale, com.ibm.icu.util.ULocale#VALID_LOCALE, com.ibm.icu.util.ULocale#ACTUAL_LOCALE
setLocaleback to summary
pack-priv final void setLocale(ULocale valid, ULocale actual)

Set information about the locales that were used to create this object. If the object was not constructed from locale data, both arguments should be set to null. Otherwise, neither should be null. The actual locale must be at the same level or less specific than the valid locale. This method is intended for use by factories or other entities that create objects of this class.

Parameters
valid:ULocale

the most specific locale containing any resource data, or null

actual:ULocale

the locale containing data used to construct this object, or null

See Also
com.ibm.icu.util.ULocale, com.ibm.icu.util.ULocale#VALID_LOCALE, com.ibm.icu.util.ULocale#ACTUAL_LOCALE
com.ibm.icu.text back to summary

public abstract Class UFormat.SpanField

extends Field
Class Inheritance
Known Direct Subclasses
com.ibm.icu.number.NumberRangeFormatter.SpanField, com.ibm.icu.text.ListFormatter.SpanField, com.ibm.icu.text.DateIntervalFormat.SpanField

A field that represents a span of text that may be composed with other fields. SpanField classes usually have an associated value.
ICU Status
Stable since ICU 64.

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
protected
SpanField(String name)

Construct a new instance.

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.text.Format.Field.serialVersionUID.

Constructor Detail

SpanFieldback to summary
protected SpanField(String name)

Construct a new instance.

ICU Status
Stable since ICU 64.