1/* GENERATED SOURCE. DO NOT MODIFY. */ 2/* 3****************************************************************************** 4* Copyright (C) 2007, International Business Machines Corporation and * 5* others. All Rights Reserved. * 6****************************************************************************** 7*/ 8 9package android.icu.impl.duration; 10 11/** 12 * Formats a Period, such as '2 hours 23 minutes'. 13 * The Period defines the fields to format and their 14 * values, and the formatter defines how to format them. 15 * <p> 16 * PeriodFormatters are immutable. 17 * <p> 18 * PeriodFormatter can be instantiated using a PeriodFormatterFactory. 19 * 20 * @see Period 21 * @see PeriodBuilder 22 * @see PeriodFormatterFactory 23 * @hide Only a subset of ICU is exposed in Android 24 */ 25public interface PeriodFormatter { 26 /** 27 * Format a Period. 28 * 29 * @param ts the Period to format 30 * @return the formatted time 31 */ 32 String format(Period period); 33 34 /** 35 * Return a new PeriodFormatter with the same customizations but 36 * using data for a new locale. Some locales impose limits on the 37 * fields that can be directly formatter. 38 * 39 * @param localeName the name of the new locale 40 * @return a new formatter for the given locale 41 */ 42 PeriodFormatter withLocale(String localeName); 43} 44