]> gitweb.fperrin.net Git - Dictionary.git/blob - jars/icu4j-52_1/main/classes/core/src/com/ibm/icu/impl/duration/DurationFormatterFactory.java
Clean up imports.
[Dictionary.git] / jars / icu4j-52_1 / main / classes / core / src / com / ibm / icu / impl / duration / DurationFormatterFactory.java
1 /*
2 ******************************************************************************
3 * Copyright (C) 2009, International Business Machines Corporation and   *
4 * others. All Rights Reserved.                                               *
5 ******************************************************************************
6 */
7
8 package com.ibm.icu.impl.duration;
9
10 import java.util.TimeZone;
11
12 /**
13  * Factory used to construct DurationFormatters.
14  * Formatters are immutable once created.
15  * <p>
16  * Setters on the factory mutate the factory and return it,
17  * for chaining.
18  */
19 public interface DurationFormatterFactory {
20
21   /**
22    * Set the period formatter used by the factory.  New formatters created
23    * with this factory will use the given period formatter.
24    *
25    * @param formatter the formatter to use
26    * @return this DurationFormatterFactory
27    */
28   public DurationFormatterFactory setPeriodFormatter(PeriodFormatter formatter);
29
30   /**
31    * Set the builder used by the factory.  New formatters created
32    * with this factory will use the given locale.
33    *
34    * @param builder the builder to use
35    * @return this DurationFormatterFactory
36    */
37   public DurationFormatterFactory setPeriodBuilder(PeriodBuilder builder);
38
39   /**
40    * Set a fallback formatter for durations over a given limit.
41    *
42    * @param fallback the fallback formatter to use, or null
43    * @return this DurationFormatterFactory
44    */
45   public DurationFormatterFactory setFallback(DateFormatter fallback);
46
47   /**
48    * Set a fallback limit for durations over a given limit.
49    *
50    * @param fallbackLimit the fallback limit to use, or 0 if none is desired.
51    * @return this DurationFormatterFactory
52    */
53   public DurationFormatterFactory setFallbackLimit(long fallbackLimit);
54
55   /**
56    * Set the name of the locale that will be used when 
57    * creating new formatters.
58    *
59    * @param localeName the name of the Locale
60    * @return this DurationFormatterFactory
61    */
62   public DurationFormatterFactory setLocale(String localeName);
63
64   /**
65    * Set the name of the locale that will be used when 
66    * creating new formatters.
67    *
68    * @param timeZone The time zone to set.
69    * @return this DurationFormatterFactory
70    */
71   public DurationFormatterFactory setTimeZone(TimeZone timeZone);
72
73   /**
74    * Return a formatter based on this factory's current settings.
75    *
76    * @return a DurationFormatter
77    */
78   public DurationFormatter getFormatter();
79 }