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

public Class ResourceBasedPeriodFormatterDataService

extends PeriodFormatterDataService
Class Inheritance
Imports
java.io.BufferedReader, .IOException, .InputStream, .InputStreamReader, .UnsupportedEncodingException, java.util.ArrayList, .Collection, .Collections, .HashMap, .List, .Map, .MissingResourceException, com.ibm.icu.impl.ICUData, com.ibm.icu.util.ICUUncheckedIOException

A PeriodFormatterDataService that serves PeriodFormatterData objects based on data files stored as resources in this directory. These are text files named after the locale, for example, 'pfd_he_IL.txt' specifies an period formatter data file for Hebrew as spoken in Israel. Data is in a JSON-like format.

Field Summary

Modifier and TypeField and Description
private Collection<String>
private Map<String, PeriodFormatterData>
private PeriodFormatterData
private String
private static final String
private static final ResourceBasedPeriodFormatterDataService

Constructor Summary

AccessConstructor and Description
private
ResourceBasedPeriodFormatterDataService()

Constructs the service.

Method Summary

Modifier and TypeMethod and Description
public PeriodFormatterData
get(String
the name of the locale
localeName
)

Implements abstract com.ibm.icu.impl.duration.impl.PeriodFormatterDataService.get.

Returns a PeriodFormatterData for the given locale name.
public Collection<String>
getAvailableLocales()

Implements abstract com.ibm.icu.impl.duration.impl.PeriodFormatterDataService.getAvailableLocales.

Returns a collection of all the locale names supported by this service.
public static ResourceBasedPeriodFormatterDataService
getInstance()

Returns the singleton instance of this class.

Field Detail

availableLocalesback to summary
private Collection<String> availableLocales
cacheback to summary
private Map<String, PeriodFormatterData> cache
lastDataback to summary
private PeriodFormatterData lastData
lastLocaleback to summary
private String lastLocale
PATHback to summary
private static final String PATH
singletonback to summary
private static final ResourceBasedPeriodFormatterDataService singleton

Constructor Detail

ResourceBasedPeriodFormatterDataServiceback to summary
private ResourceBasedPeriodFormatterDataService()

Constructs the service.

Method Detail

getback to summary
public PeriodFormatterData get(String localeName)

Implements abstract com.ibm.icu.impl.duration.impl.PeriodFormatterDataService.get.

Doc from com.ibm.icu.impl.duration.impl.PeriodFormatterDataService.get.

Returns a PeriodFormatterData for the given locale name.

Parameters
localeName:String

the name of the locale

Returns:PeriodFormatterData

a PeriodFormatterData object

Annotations
@Override
getAvailableLocalesback to summary
public Collection<String> getAvailableLocales()

Implements abstract com.ibm.icu.impl.duration.impl.PeriodFormatterDataService.getAvailableLocales.

Doc from com.ibm.icu.impl.duration.impl.PeriodFormatterDataService.getAvailableLocales.

Returns a collection of all the locale names supported by this service.

Returns:Collection<String>

a collection of locale names, as String

Annotations
@Override
getInstanceback to summary
public static ResourceBasedPeriodFormatterDataService getInstance()

Returns the singleton instance of this class.