Package com.ibm.icu.impl.duration
Interface PeriodFormatterFactory
- All Known Implementing Classes:
BasicPeriodFormatterFactory
public interface PeriodFormatterFactory
Abstract factory interface used to create PeriodFormatters.
PeriodFormatters are immutable once created.
Setters on the factory mutate the factory and return it, for chaining.
-
Method Summary
Modifier and TypeMethodDescriptionReturn a formatter based on this factory's current settings.setCountVariant
(int variant) Set the variant of the count to use.setDisplayLimit
(boolean display) Set whether limits will be displayed.setDisplayPastFuture
(boolean display) Set whether past and future will be displayed.Set the name of the locale that will be used when creating new formatters.setSeparatorVariant
(int variant) Set how separators will be displayed.setUnitVariant
(int variant) Set the variant of the time unit names to use.
-
Method Details
-
setLocale
Set the name of the locale that will be used when creating new formatters.- Parameters:
localeName
- the name of the Locale- Returns:
- this PeriodFormatterFactory
-
setDisplayLimit
Set whether limits will be displayed.- Parameters:
display
- true if limits will be displayed- Returns:
- this PeriodFormatterFactory
-
setDisplayPastFuture
Set whether past and future will be displayed.- Parameters:
display
- true if past and future will be displayed- Returns:
- this PeriodFormatterFactory
-
setSeparatorVariant
Set how separators will be displayed.- Parameters:
variant
- the variant indicating how separators will be displayed- Returns:
- this PeriodFormatterFactory
-
setUnitVariant
Set the variant of the time unit names to use.- Parameters:
variant
- the variant to use- Returns:
- this PeriodFormatterFactory
-
setCountVariant
Set the variant of the count to use.- Parameters:
variant
- the variant to use- Returns:
- this PeriodFormatterFactory
-
getFormatter
PeriodFormatter getFormatter()Return a formatter based on this factory's current settings.- Returns:
- a PeriodFormatter
-