Package com.ibm.icu.impl.duration
Interface PeriodFormatter
-
public interface PeriodFormatterFormats 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 Stringformat(Period period)Format a Period.PeriodFormatterwithLocale(String localeName)Return a new PeriodFormatter with the same customizations but using data for a new locale.
-
-
-
Method Detail
-
format
String format(Period period)
Format a Period.- Parameters:
ts- the Period to format- Returns:
- the formatted time
-
withLocale
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- the name of the new locale- Returns:
- a new formatter for the given locale
-
-