]> gitweb.fperrin.net Git - Dictionary.git/blob - jars/icu4j-4_4_2-src/main/classes/core/src/com/ibm/icu/impl/duration/PeriodFormatter.java
go
[Dictionary.git] / jars / icu4j-4_4_2-src / main / classes / core / src / com / ibm / icu / impl / duration / PeriodFormatter.java
1 /*\r
2 ******************************************************************************\r
3 * Copyright (C) 2007, International Business Machines Corporation and   *\r
4 * others. All Rights Reserved.                                               *\r
5 ******************************************************************************\r
6 */\r
7 \r
8 package com.ibm.icu.impl.duration;\r
9 \r
10 /**\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
14  * <p>\r
15  * PeriodFormatters are immutable.\r
16  * <p> \r
17  * PeriodFormatter can be instantiated using a PeriodFormatterFactory.\r
18  *\r
19  * @see Period\r
20  * @see PeriodBuilder\r
21  * @see PeriodFormatterFactory\r
22  */\r
23 public interface PeriodFormatter {\r
24   /**\r
25    * Format a Period.\r
26    *\r
27    * @param ts the Period to format\r
28    * @return the formatted time\r
29    */\r
30   String format(Period period);\r
31 \r
32   /**\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
36    *\r
37    * @param localeName the name of the new locale\r
38    * @return a new formatter for the given locale\r
39    */\r
40   PeriodFormatter withLocale(String localeName);\r
41 }\r