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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description PeriodFormatter
getFormatter()
Return a formatter based on this factory's current settings.PeriodFormatterFactory
setCountVariant(int variant)
Set the variant of the count to use.PeriodFormatterFactory
setDisplayLimit(boolean display)
Set whether limits will be displayed.PeriodFormatterFactory
setDisplayPastFuture(boolean display)
Set whether past and future will be displayed.PeriodFormatterFactory
setLocale(java.lang.String localeName)
Set the name of the locale that will be used when creating new formatters.PeriodFormatterFactory
setSeparatorVariant(int variant)
Set how separators will be displayed.PeriodFormatterFactory
setUnitVariant(int variant)
Set the variant of the time unit names to use.
-
-
-
Method Detail
-
setLocale
PeriodFormatterFactory setLocale(java.lang.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
-
-