2 ******************************************************************************
\r
3 * Copyright (C) 2007, International Business Machines Corporation and *
\r
4 * others. All Rights Reserved. *
\r
5 ******************************************************************************
\r
8 package com.ibm.icu.impl.duration;
\r
11 * Abstract factory interface used to create PeriodFormatters.
\r
12 * PeriodFormatters are immutable once created.
\r
14 * Setters on the factory mutate the factory and return it,
\r
17 public interface PeriodFormatterFactory {
\r
20 * Set the name of the locale that will be used when
\r
21 * creating new formatters.
\r
23 * @param localeName the name of the Locale
\r
24 * @return this PeriodFormatterFactory
\r
26 public PeriodFormatterFactory setLocale(String localeName);
\r
29 * Set whether limits will be displayed.
\r
31 * @param display true if limits will be displayed
\r
32 * @return this PeriodFormatterFactory
\r
34 public PeriodFormatterFactory setDisplayLimit(boolean display);
\r
37 * Set whether past and future will be displayed.
\r
39 * @param display true if past and future will be displayed
\r
40 * @return this PeriodFormatterFactory
\r
42 public PeriodFormatterFactory setDisplayPastFuture(boolean display);
\r
45 * Set how separators will be displayed.
\r
47 * @param variant the variant indicating how separators will be displayed
\r
48 * @return this PeriodFormatterFactory
\r
50 public PeriodFormatterFactory setSeparatorVariant(int variant);
\r
53 * Set the variant of the time unit names to use.
\r
55 * @param variant the variant to use
\r
56 * @return this PeriodFormatterFactory
\r
58 public PeriodFormatterFactory setUnitVariant(int variant);
\r
61 * Set the variant of the count to use.
\r
63 * @param variant the variant to use
\r
64 * @return this PeriodFormatterFactory
\r
66 public PeriodFormatterFactory setCountVariant(int variant);
\r
69 * Return a formatter based on this factory's current settings.
\r
71 * @return a PeriodFormatter
\r
73 public PeriodFormatter getFormatter();
\r