2 ******************************************************************************
\r
3 * Copyright (C) 2009, International Business Machines Corporation and *
\r
4 * others. All Rights Reserved. *
\r
5 ******************************************************************************
\r
8 package com.ibm.icu.impl.duration;
\r
10 import java.util.TimeZone;
\r
13 * Factory used to construct DurationFormatters.
\r
14 * Formatters are immutable once created.
\r
16 * Setters on the factory mutate the factory and return it,
\r
19 public interface DurationFormatterFactory {
\r
22 * Set the period formatter used by the factory. New formatters created
\r
23 * with this factory will use the given period formatter.
\r
25 * @param formatter the formatter to use
\r
26 * @return this DurationFormatterFactory
\r
28 public DurationFormatterFactory setPeriodFormatter(PeriodFormatter formatter);
\r
31 * Set the builder used by the factory. New formatters created
\r
32 * with this factory will use the given locale.
\r
34 * @param builder the builder to use
\r
35 * @return this DurationFormatterFactory
\r
37 public DurationFormatterFactory setPeriodBuilder(PeriodBuilder builder);
\r
40 * Set a fallback formatter for durations over a given limit.
\r
42 * @param fallback the fallback formatter to use, or null
\r
43 * @return this DurationFormatterFactory
\r
45 public DurationFormatterFactory setFallback(DateFormatter fallback);
\r
48 * Set a fallback limit for durations over a given limit.
\r
50 * @param fallbackLimit the fallback limit to use, or 0 if none is desired.
\r
51 * @return this DurationFormatterFactory
\r
53 public DurationFormatterFactory setFallbackLimit(long fallbackLimit);
\r
56 * Set the name of the locale that will be used when
\r
57 * creating new formatters.
\r
59 * @param localeName the name of the Locale
\r
60 * @return this DurationFormatterFactory
\r
62 public DurationFormatterFactory setLocale(String localeName);
\r
65 * Set the name of the locale that will be used when
\r
66 * creating new formatters.
\r
68 * @param timeZone The time zone to set.
\r
69 * @return this DurationFormatterFactory
\r
71 public DurationFormatterFactory setTimeZone(TimeZone timeZone);
\r
74 * Return a formatter based on this factory's current settings.
\r
76 * @return a DurationFormatter
\r
78 public DurationFormatter getFormatter();
\r