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