All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.ibm.icu.impl.duration.PeriodFormatter Maven / Gradle / Ivy

Go to download

International Component for Unicode for Java (ICU4J) is a mature, widely used Java library providing Unicode and Globalization support

There is a newer version: 76.1
Show newest version
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
******************************************************************************
* Copyright (C) 2007, International Business Machines Corporation and   *
* others. All Rights Reserved.                                               *
******************************************************************************
*/

package com.ibm.icu.impl.duration;

/**
 * Formats a Period, such as '2 hours 23 minutes'.  
 * The Period defines the fields to format and their
 * values, and the formatter defines how to format them.
 * 

* PeriodFormatters are immutable. *

* PeriodFormatter can be instantiated using a PeriodFormatterFactory. * * @see Period * @see PeriodBuilder * @see PeriodFormatterFactory */ public interface PeriodFormatter { /** * Format a Period. * * @param ts the Period to format * @return the formatted time */ String format(Period period); /** * Return a new PeriodFormatter with the same customizations but * using data for a new locale. Some locales impose limits on the * fields that can be directly formatter. * * @param localeName the name of the new locale * @return a new formatter for the given locale */ PeriodFormatter withLocale(String localeName); }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy