Top Description Methods
com.ibm.icu.impl.duration

public Interface PeriodFormatter

Known Direct Implementers
com.ibm.icu.impl.duration.BasicPeriodFormatter

Formats a Period, such as '2 hours 23 minutes'. The Period defines the fields to format and their values, and the formatter defines how to format them.

PeriodFormatters are immutable.

PeriodFormatter can be instantiated using a PeriodFormatterFactory.

See Also
Period, PeriodBuilder, PeriodFormatterFactory

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the formatted time
format
(Period
the Period to format
period
)

Format a Period.

public PeriodFormatter

Returns:

a new formatter for the given locale
withLocale
(String
the name of the new locale
localeName
)

Return a new PeriodFormatter with the same customizations but using data for a new locale.

Method Detail

formatback to summary
public String format(Period period)

Format a Period.

Parameters
period:Period

the Period to format

Returns:String

the formatted time

withLocaleback to summary
public PeriodFormatter withLocale(String localeName)

Return a new PeriodFormatter with the same customizations but using data for a new locale. Some locales impose limits on the fields that can be directly formatter.

Parameters
localeName:String

the name of the new locale

Returns:PeriodFormatter

a new formatter for the given locale