Top Description Fields Constructors Methods
com.ibm.icu.impl.duration

pack-priv Class BasicPeriodFormatter

extends Object
implements PeriodFormatter
Class Inheritance
All Implemented Interfaces
com.ibm.icu.impl.duration.PeriodFormatter
Imports
com.ibm.icu.impl.duration.BasicPeriodFormatterFactory.Customizations, com.ibm.icu.impl.duration.impl.DataRecord.ECountVariant, .DataRecord.EMilliSupport, .DataRecord.ESeparatorVariant, .DataRecord.ETimeDirection, .DataRecord.ETimeLimit, .PeriodFormatterData

Core implementation class for PeriodFormatter.

Field Summary

Modifier and TypeField and Description
private BasicPeriodFormatterFactory.Customizations
private PeriodFormatterData
private BasicPeriodFormatterFactory
private String

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public String
format(Period
the Period to format
period
)

Implements com.ibm.icu.impl.duration.PeriodFormatter.format.

Format a Period.
private String
format(int tl, boolean inFuture, int[] counts)

public PeriodFormatter
withLocale(String
the name of the new locale
locName
)

Implements com.ibm.icu.impl.duration.PeriodFormatter.withLocale.

Return a new PeriodFormatter with the same customizations but using data for a new locale.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

customsback to summary
private BasicPeriodFormatterFactory.Customizations customs
databack to summary
private PeriodFormatterData data
factoryback to summary
private BasicPeriodFormatterFactory factory
localeNameback to summary
private String localeName

Constructor Detail

BasicPeriodFormatterback to summary
pack-priv BasicPeriodFormatter(BasicPeriodFormatterFactory factory, String localeName, PeriodFormatterData data, BasicPeriodFormatterFactory.Customizations customs)

Method Detail

formatback to summary
public String format(Period period)

Implements com.ibm.icu.impl.duration.PeriodFormatter.format.

Doc from com.ibm.icu.impl.duration.PeriodFormatter.format.

Format a Period.

Parameters
period:Period

the Period to format

Returns:String

the formatted time

Annotations
@Override
formatback to summary
private String format(int tl, boolean inFuture, int[] counts)
withLocaleback to summary
public PeriodFormatter withLocale(String locName)

Implements com.ibm.icu.impl.duration.PeriodFormatter.withLocale.

Doc from com.ibm.icu.impl.duration.PeriodFormatter.withLocale.

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.

Parameters
locName:String

the name of the new locale

Returns:PeriodFormatter

a new formatter for the given locale

Annotations
@Override