1 // 2016 and later: Unicode, Inc. and others. 2 // License & terms of use: http://www.unicode.org/copyright.html#License 3 /* 4 ****************************************************************************** 5 * Copyright (C) 2007, International Business Machines Corporation and * 6 * others. All Rights Reserved. * 7 ****************************************************************************** 8 */ 9 10 package com.ibm.icu.impl.duration; 11 12 /** 13 * Abstract factory interface used to create PeriodFormatters. 14 * PeriodFormatters are immutable once created. 15 * <p> 16 * Setters on the factory mutate the factory and return it, 17 * for chaining. 18 */ 19 public interface PeriodFormatterFactory { 20 21 /** 22 * Set the name of the locale that will be used when 23 * creating new formatters. 24 * 25 * @param localeName the name of the Locale 26 * @return this PeriodFormatterFactory 27 */ 28 public PeriodFormatterFactory setLocale(String localeName); 29 30 /** 31 * Set whether limits will be displayed. 32 * 33 * @param display true if limits will be displayed 34 * @return this PeriodFormatterFactory 35 */ 36 public PeriodFormatterFactory setDisplayLimit(boolean display); 37 38 /** 39 * Set whether past and future will be displayed. 40 * 41 * @param display true if past and future will be displayed 42 * @return this PeriodFormatterFactory 43 */ 44 public PeriodFormatterFactory setDisplayPastFuture(boolean display); 45 46 /** 47 * Set how separators will be displayed. 48 * 49 * @param variant the variant indicating how separators will be displayed 50 * @return this PeriodFormatterFactory 51 */ 52 public PeriodFormatterFactory setSeparatorVariant(int variant); 53 54 /** 55 * Set the variant of the time unit names to use. 56 * 57 * @param variant the variant to use 58 * @return this PeriodFormatterFactory 59 */ 60 public PeriodFormatterFactory setUnitVariant(int variant); 61 62 /** 63 * Set the variant of the count to use. 64 * 65 * @param variant the variant to use 66 * @return this PeriodFormatterFactory 67 */ 68 public PeriodFormatterFactory setCountVariant(int variant); 69 70 /** 71 * Return a formatter based on this factory's current settings. 72 * 73 * @return a PeriodFormatter 74 */ 75 public PeriodFormatter getFormatter(); 76 } 77