Added in API level 24

UFormat


abstract class UFormat : Format
DateFormat

[icu enhancement] ICU's replacement for java.text.DateFormat.

DateIntervalFormat

DateIntervalFormat is a class for formatting and parsing date intervals in a language-independent manner.

MeasureFormat

A formatter for Measure objects.

MessageFormat

[icu enhancement] ICU's replacement for java.text.MessageFormat.

NumberFormat

[icu enhancement] ICU's replacement for java.text.NumberFormat.

PluralFormat

PluralFormat supports the creation of internationalized messages with plural inflection.

TimeZoneFormat

TimeZoneFormat supports time zone display name formatting and parsing.

CompactDecimalFormat

Formats numbers in compact (abbreviated) notation, like "1.

DecimalFormat

[icu enhancement] ICU's replacement for java.text.DecimalFormat.

SimpleDateFormat

[icu enhancement] ICU's replacement for java.text.SimpleDateFormat.

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.

Summary

Public constructors

Default constructor.

Inherited functions
Any clone()

Creates and returns a copy of this object.

String! format(obj: Any!)

Formats an object to produce a string. This is equivalent to format(obj, new StringBuffer(), new FieldPosition(0)).toString();

StringBuffer! format(obj: Any!, toAppendTo: StringBuffer!, pos: FieldPosition!)

Formats an object and appends the resulting text to a given string buffer. If the pos argument identifies a field used by the format, then its indices are set to the beginning and end of the first such field encountered.

AttributedCharacterIterator! formatToCharacterIterator(obj: Any!)

Formats an Object producing an AttributedCharacterIterator. You can use the returned AttributedCharacterIterator to build the resulting String, as well as to determine information about the resulting String.

Each attribute key of the AttributedCharacterIterator will be of type Field. It is up to each Format implementation to define what the legal values are for each attribute in the AttributedCharacterIterator, but typically the attribute key is also used as the attribute value.

The default implementation creates an AttributedCharacterIterator with no attributes. Subclasses that support fields should override this and create an AttributedCharacterIterator with meaningful attributes.

Any! parseObject(source: String!)

Parses text from the beginning of the given string to produce an object. The method may not use the entire text of the given string.

Any! parseObject(source: String!, pos: ParsePosition!)

Parses text from a string to produce an object.

The method attempts to parse text starting at the index given by pos. If parsing succeeds, then the index of pos is updated to the index after the last character used (parsing does not necessarily use all characters up to the end of the string), and the parsed object is returned. The updated pos can be used to indicate the starting point for the next call to this method. If an error occurs, then the index of pos is not changed, the error index of pos is set to the index of the character where the error occurred, and null is returned.

Public constructors

UFormat

Added in API level 24
UFormat()

Default constructor.