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