Top Description Methods
com.ibm.icu.impl.duration

public Interface DurationFormatterFactory

Known Direct Implementers
com.ibm.icu.impl.duration.BasicDurationFormatterFactory
Imports
java.util.TimeZone

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 TypeMethod and Description
public DurationFormatter

Returns:

a DurationFormatter
getFormatter
()

Return a formatter based on this factory's current settings.

public DurationFormatterFactory

Returns:

this DurationFormatterFactory
setFallback
(DateFormatter
the fallback formatter to use, or null
fallback
)

Set a fallback formatter for durations over a given limit.

public DurationFormatterFactory

Returns:

this DurationFormatterFactory
setFallbackLimit
(long
the fallback limit to use, or 0 if none is desired.
fallbackLimit
)

Set a fallback limit for durations over a given limit.

public DurationFormatterFactory

Returns:

this DurationFormatterFactory
setLocale
(String
the name of the Locale
localeName
)

Set the name of the locale that will be used when creating new formatters.

public DurationFormatterFactory

Returns:

this DurationFormatterFactory
setPeriodBuilder
(PeriodBuilder
the builder to use
builder
)

Set the builder used by the factory.

public DurationFormatterFactory

Returns:

this DurationFormatterFactory
setPeriodFormatter
(PeriodFormatter
the formatter to use
formatter
)

Set the period formatter used by the factory.

public DurationFormatterFactory

Returns:

this DurationFormatterFactory
setTimeZone
(TimeZone
The time zone to set.
timeZone
)

Set the name of the locale that will be used when creating new formatters.

Method Detail

getFormatterback to summary
public DurationFormatter getFormatter()

Return a formatter based on this factory's current settings.

Returns:DurationFormatter

a DurationFormatter

setFallbackback to summary
public DurationFormatterFactory setFallback(DateFormatter fallback)

Set a fallback formatter for durations over a given limit.

Parameters
fallback:DateFormatter

the fallback formatter to use, or null

Returns:DurationFormatterFactory

this DurationFormatterFactory

setFallbackLimitback to summary
public DurationFormatterFactory setFallbackLimit(long fallbackLimit)

Set a fallback limit for durations over a given limit.

Parameters
fallbackLimit:long

the fallback limit to use, or 0 if none is desired.

Returns:DurationFormatterFactory

this DurationFormatterFactory

setLocaleback to summary
public DurationFormatterFactory setLocale(String localeName)

Set the name of the locale that will be used when creating new formatters.

Parameters
localeName:String

the name of the Locale

Returns:DurationFormatterFactory

this DurationFormatterFactory

setPeriodBuilderback to summary
public DurationFormatterFactory setPeriodBuilder(PeriodBuilder builder)

Set the builder used by the factory. New formatters created with this factory will use the given locale.

Parameters
builder:PeriodBuilder

the builder to use

Returns:DurationFormatterFactory

this DurationFormatterFactory

setPeriodFormatterback to summary
public 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:PeriodFormatter

the formatter to use

Returns:DurationFormatterFactory

this DurationFormatterFactory

setTimeZoneback to summary
public DurationFormatterFactory setTimeZone(TimeZone timeZone)

Set the name of the locale that will be used when creating new formatters.

Parameters
timeZone:TimeZone

The time zone to set.

Returns:DurationFormatterFactory

this DurationFormatterFactory