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 * Formats a Period, such as '2 hours 23 minutes'.
\r
12 * The Period defines the fields to format and their
\r
13 * values, and the formatter defines how to format them.
\r
15 * PeriodFormatters are immutable.
\r
17 * PeriodFormatter can be instantiated using a PeriodFormatterFactory.
\r
20 * @see PeriodBuilder
\r
21 * @see PeriodFormatterFactory
\r
23 public interface PeriodFormatter {
\r
27 * @param ts the Period to format
\r
28 * @return the formatted time
\r
30 String format(Period period);
\r
33 * Return a new PeriodFormatter with the same customizations but
\r
34 * using data for a new locale. Some locales impose limits on the
\r
35 * fields that can be directly formatter.
\r
37 * @param localeName the name of the new locale
\r
38 * @return a new formatter for the given locale
\r
40 PeriodFormatter withLocale(String localeName);
\r