Package com.ibm.icu.text
Class UFormat
- java.lang.Object
-
- java.text.Format
-
- com.ibm.icu.text.UFormat
-
- All Implemented Interfaces:
Serializable
,Cloneable
- Direct Known Subclasses:
DateFormat
,DateIntervalFormat
,DurationFormat
,MeasureFormat
,MessageFormat
,NumberFormat
,PluralFormat
,TimeZoneFormat
public abstract class UFormat extends Format
An abstract class that extendsFormat
to provide additional ICU protocol, specifically, thegetLocale()
API. All ICU format classes are subclasses of this class.- Author:
- weiv, Alan Liu
- See Also:
ULocale
, Serialized Form- Status:
- Stable ICU 2.8.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
UFormat.SpanField
A field that represents a span of text that may be composed with other fields.-
Nested classes/interfaces inherited from class java.text.Format
Format.Field
-
-
Constructor Summary
Constructors Constructor Description UFormat()
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ULocale
getLocale(ULocale.Type type)
Return the locale that was used to create this object, or null.-
Methods inherited from class java.text.Format
clone, format, format, formatToCharacterIterator, parseObject, parseObject
-
-
-
-
Method Detail
-
getLocale
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 localeen_US_CALIFORNIA
, the actual data may be drawn fromen
(the actual locale), anden_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
- type of information requested, eitherULocale.VALID_LOCALE
orULocale.ACTUAL_LOCALE
.- Returns:
- the information specified by type, or null if this object was not constructed from locale data.
- See Also:
ULocale
,ULocale.VALID_LOCALE
,ULocale.ACTUAL_LOCALE
- Status:
- Draft ICU 2.8 (retain).
-
-