Package com.ibm.icu.impl.duration.impl
Class ResourceBasedPeriodFormatterDataService
- java.lang.Object
-
- com.ibm.icu.impl.duration.impl.PeriodFormatterDataService
-
- com.ibm.icu.impl.duration.impl.ResourceBasedPeriodFormatterDataService
-
public class ResourceBasedPeriodFormatterDataService extends PeriodFormatterDataService
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
Fields Modifier and Type Field Description private java.util.Collection<java.lang.String>
availableLocales
private java.util.Map<java.lang.String,PeriodFormatterData>
cache
private PeriodFormatterData
lastData
private java.lang.String
lastLocale
private static java.lang.String
PATH
private static ResourceBasedPeriodFormatterDataService
singleton
-
Constructor Summary
Constructors Modifier Constructor Description private
ResourceBasedPeriodFormatterDataService()
Constructs the service.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description PeriodFormatterData
get(java.lang.String localeName)
Returns a PeriodFormatterData for the given locale name.java.util.Collection<java.lang.String>
getAvailableLocales()
Returns a collection of all the locale names supported by this service.static ResourceBasedPeriodFormatterDataService
getInstance()
Returns the singleton instance of this class.
-
-
-
Field Detail
-
availableLocales
private java.util.Collection<java.lang.String> availableLocales
-
lastData
private PeriodFormatterData lastData
-
lastLocale
private java.lang.String lastLocale
-
cache
private java.util.Map<java.lang.String,PeriodFormatterData> cache
-
PATH
private static final java.lang.String PATH
- See Also:
- Constant Field Values
-
singleton
private static final ResourceBasedPeriodFormatterDataService singleton
-
-
Method Detail
-
getInstance
public static ResourceBasedPeriodFormatterDataService getInstance()
Returns the singleton instance of this class.
-
get
public PeriodFormatterData get(java.lang.String localeName)
Description copied from class:PeriodFormatterDataService
Returns a PeriodFormatterData for the given locale name.- Specified by:
get
in classPeriodFormatterDataService
- Parameters:
localeName
- the name of the locale- Returns:
- a PeriodFormatterData object
-
getAvailableLocales
public java.util.Collection<java.lang.String> getAvailableLocales()
Description copied from class:PeriodFormatterDataService
Returns a collection of all the locale names supported by this service.- Specified by:
getAvailableLocales
in classPeriodFormatterDataService
- Returns:
- a collection of locale names, as String
-
-