• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* GENERATED SOURCE. DO NOT MODIFY. */
2 // © 2016 and later: Unicode, Inc. and others.
3 // License & terms of use: http://www.unicode.org/copyright.html#License
4 /*
5 ******************************************************************************
6 * Copyright (C) 2009, International Business Machines Corporation and   *
7 * others. All Rights Reserved.                                               *
8 ******************************************************************************
9 */
10 
11 package ohos.global.icu.impl.duration;
12 
13 import java.util.TimeZone;
14 
15 /**
16  * Factory used to construct DurationFormatters.
17  * Formatters are immutable once created.
18  * <p>
19  * Setters on the factory mutate the factory and return it,
20  * for chaining.
21  * @hide exposed on OHOS
22  */
23 public interface DurationFormatterFactory {
24 
25   /**
26    * Set the period formatter used by the factory.  New formatters created
27    * with this factory will use the given period formatter.
28    *
29    * @param formatter the formatter to use
30    * @return this DurationFormatterFactory
31    */
setPeriodFormatter(PeriodFormatter formatter)32   public DurationFormatterFactory setPeriodFormatter(PeriodFormatter formatter);
33 
34   /**
35    * Set the builder used by the factory.  New formatters created
36    * with this factory will use the given locale.
37    *
38    * @param builder the builder to use
39    * @return this DurationFormatterFactory
40    */
setPeriodBuilder(PeriodBuilder builder)41   public DurationFormatterFactory setPeriodBuilder(PeriodBuilder builder);
42 
43   /**
44    * Set a fallback formatter for durations over a given limit.
45    *
46    * @param fallback the fallback formatter to use, or null
47    * @return this DurationFormatterFactory
48    */
setFallback(DateFormatter fallback)49   public DurationFormatterFactory setFallback(DateFormatter fallback);
50 
51   /**
52    * Set a fallback limit for durations over a given limit.
53    *
54    * @param fallbackLimit the fallback limit to use, or 0 if none is desired.
55    * @return this DurationFormatterFactory
56    */
setFallbackLimit(long fallbackLimit)57   public DurationFormatterFactory setFallbackLimit(long fallbackLimit);
58 
59   /**
60    * Set the name of the locale that will be used when
61    * creating new formatters.
62    *
63    * @param localeName the name of the Locale
64    * @return this DurationFormatterFactory
65    */
setLocale(String localeName)66   public DurationFormatterFactory setLocale(String localeName);
67 
68   /**
69    * Set the name of the locale that will be used when
70    * creating new formatters.
71    *
72    * @param timeZone The time zone to set.
73    * @return this DurationFormatterFactory
74    */
setTimeZone(TimeZone timeZone)75   public DurationFormatterFactory setTimeZone(TimeZone timeZone);
76 
77   /**
78    * Return a formatter based on this factory's current settings.
79    *
80    * @return a DurationFormatter
81    */
getFormatter()82   public DurationFormatter getFormatter();
83 }
84