Package com.ibm.icu.impl.duration
Interface PeriodFormatterFactory
-
- All Known Implementing Classes:
BasicPeriodFormatterFactory
public interface PeriodFormatterFactoryAbstract 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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description PeriodFormattergetFormatter()Return a formatter based on this factory's current settings.PeriodFormatterFactorysetCountVariant(int variant)Set the variant of the count to use.PeriodFormatterFactorysetDisplayLimit(boolean display)Set whether limits will be displayed.PeriodFormatterFactorysetDisplayPastFuture(boolean display)Set whether past and future will be displayed.PeriodFormatterFactorysetLocale(String localeName)Set the name of the locale that will be used when creating new formatters.PeriodFormatterFactorysetSeparatorVariant(int variant)Set how separators will be displayed.PeriodFormatterFactorysetUnitVariant(int variant)Set the variant of the time unit names to use.
-
-
-
Method Detail
-
setLocale
PeriodFormatterFactory setLocale(String localeName)
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
PeriodFormatterFactory setDisplayLimit(boolean display)
Set whether limits will be displayed.- Parameters:
display- true if limits will be displayed- Returns:
- this PeriodFormatterFactory
-
setDisplayPastFuture
PeriodFormatterFactory setDisplayPastFuture(boolean display)
Set whether past and future will be displayed.- Parameters:
display- true if past and future will be displayed- Returns:
- this PeriodFormatterFactory
-
setSeparatorVariant
PeriodFormatterFactory setSeparatorVariant(int variant)
Set how separators will be displayed.- Parameters:
variant- the variant indicating how separators will be displayed- Returns:
- this PeriodFormatterFactory
-
setUnitVariant
PeriodFormatterFactory setUnitVariant(int variant)
Set the variant of the time unit names to use.- Parameters:
variant- the variant to use- Returns:
- this PeriodFormatterFactory
-
setCountVariant
PeriodFormatterFactory setCountVariant(int variant)
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
-
-