Package com.ibm.icu.impl.duration
Interface PeriodFormatter
-
- All Known Implementing Classes:
BasicPeriodFormatter
public interface PeriodFormatter
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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String
format(Period period)
Format a Period.PeriodFormatter
withLocale(java.lang.String localeName)
Return a new PeriodFormatter with the same customizations but using data for a new locale.
-
-
-
Method Detail
-
format
java.lang.String format(Period period)
Format a Period.- Parameters:
ts
- the Period to format- Returns:
- the formatted time
-
withLocale
PeriodFormatter withLocale(java.lang.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
- the name of the new locale- Returns:
- a new formatter for the given locale
-
-