Package com.ibm.icu.impl.duration
Interface DurationFormatterFactory
- All Known Implementing Classes:
BasicDurationFormatterFactory
public interface DurationFormatterFactory
Factory used to construct DurationFormatters.
Formatters 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.setFallback
(DateFormatter fallback) Set a fallback formatter for durations over a given limit.setFallbackLimit
(long fallbackLimit) Set a fallback limit for durations over a given limit.Set the name of the locale that will be used when creating new formatters.setPeriodBuilder
(PeriodBuilder builder) Set the builder used by the factory.setPeriodFormatter
(PeriodFormatter formatter) Set the period formatter used by the factory.setTimeZone
(TimeZone timeZone) Set the name of the locale that will be used when creating new formatters.
-
Method Details
-
setPeriodFormatter
Set the period formatter used by the factory. New formatters created with this factory will use the given period formatter.- Parameters:
formatter
- the formatter to use- Returns:
- this DurationFormatterFactory
-
setPeriodBuilder
Set the builder used by the factory. New formatters created with this factory will use the given locale.- Parameters:
builder
- the builder to use- Returns:
- this DurationFormatterFactory
-
setFallback
Set a fallback formatter for durations over a given limit.- Parameters:
fallback
- the fallback formatter to use, or null- Returns:
- this DurationFormatterFactory
-
setFallbackLimit
Set a fallback limit for durations over a given limit.- Parameters:
fallbackLimit
- the fallback limit to use, or 0 if none is desired.- Returns:
- this DurationFormatterFactory
-
setLocale
Set the name of the locale that will be used when creating new formatters.- Parameters:
localeName
- the name of the Locale- Returns:
- this DurationFormatterFactory
-
setTimeZone
Set the name of the locale that will be used when creating new formatters.- Parameters:
timeZone
- The time zone to set.- Returns:
- this DurationFormatterFactory
-
getFormatter
DurationFormatter getFormatter()Return a formatter based on this factory's current settings.- Returns:
- a DurationFormatter
-