Package com.ibm.icu.impl.duration
Class BasicPeriodFormatter
- java.lang.Object
-
- com.ibm.icu.impl.duration.BasicPeriodFormatter
-
- All Implemented Interfaces:
PeriodFormatter
class BasicPeriodFormatter extends java.lang.Object implements PeriodFormatter
Core implementation class for PeriodFormatter.
-
-
Field Summary
Fields Modifier and Type Field Description private BasicPeriodFormatterFactory.Customizations
customs
private PeriodFormatterData
data
private BasicPeriodFormatterFactory
factory
private java.lang.String
localeName
-
Constructor Summary
Constructors Constructor Description BasicPeriodFormatter(BasicPeriodFormatterFactory factory, java.lang.String localeName, PeriodFormatterData data, BasicPeriodFormatterFactory.Customizations customs)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.String
format(int tl, boolean inFuture, int[] counts)
java.lang.String
format(Period period)
Format a Period.PeriodFormatter
withLocale(java.lang.String locName)
Return a new PeriodFormatter with the same customizations but using data for a new locale.
-
-
-
Field Detail
-
factory
private BasicPeriodFormatterFactory factory
-
localeName
private java.lang.String localeName
-
data
private PeriodFormatterData data
-
customs
private BasicPeriodFormatterFactory.Customizations customs
-
-
Constructor Detail
-
BasicPeriodFormatter
BasicPeriodFormatter(BasicPeriodFormatterFactory factory, java.lang.String localeName, PeriodFormatterData data, BasicPeriodFormatterFactory.Customizations customs)
-
-
Method Detail
-
format
public java.lang.String format(Period period)
Description copied from interface:PeriodFormatter
Format a Period.- Specified by:
format
in interfacePeriodFormatter
- Returns:
- the formatted time
-
withLocale
public PeriodFormatter withLocale(java.lang.String locName)
Description copied from interface:PeriodFormatter
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.- Specified by:
withLocale
in interfacePeriodFormatter
- Parameters:
locName
- the name of the new locale- Returns:
- a new formatter for the given locale
-
format
private java.lang.String format(int tl, boolean inFuture, int[] counts)
-
-