Package com.ibm.icu.impl.duration
Interface DurationFormatterFactory
-
public interface DurationFormatterFactoryFactory used to construct DurationFormatters. Formatters 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 DurationFormattergetFormatter()Return a formatter based on this factory's current settings.DurationFormatterFactorysetFallback(DateFormatter fallback)Set a fallback formatter for durations over a given limit.DurationFormatterFactorysetFallbackLimit(long fallbackLimit)Set a fallback limit for durations over a given limit.DurationFormatterFactorysetLocale(String localeName)Set the name of the locale that will be used when creating new formatters.DurationFormatterFactorysetPeriodBuilder(PeriodBuilder builder)Set the builder used by the factory.DurationFormatterFactorysetPeriodFormatter(PeriodFormatter formatter)Set the period formatter used by the factory.DurationFormatterFactorysetTimeZone(TimeZone timeZone)Set the name of the locale that will be used when creating new formatters.
-
-
-
Method Detail
-
setPeriodFormatter
DurationFormatterFactory setPeriodFormatter(PeriodFormatter formatter)
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
DurationFormatterFactory setPeriodBuilder(PeriodBuilder builder)
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
DurationFormatterFactory setFallback(DateFormatter fallback)
Set a fallback formatter for durations over a given limit.- Parameters:
fallback- the fallback formatter to use, or null- Returns:
- this DurationFormatterFactory
-
setFallbackLimit
DurationFormatterFactory setFallbackLimit(long fallbackLimit)
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
DurationFormatterFactory 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 DurationFormatterFactory
-
setTimeZone
DurationFormatterFactory setTimeZone(TimeZone timeZone)
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
-
-