Package org.threeten.bp.format
Class SimpleDateTimeFormatStyleProvider
- java.lang.Object
-
- org.threeten.bp.format.DateTimeFormatStyleProvider
-
- org.threeten.bp.format.SimpleDateTimeFormatStyleProvider
-
final class SimpleDateTimeFormatStyleProvider extends DateTimeFormatStyleProvider
The Service Provider Implementation to obtain date-time formatters for a style.This implementation is based on extraction of data from a
SimpleDateFormat.Specification for implementors
This class is immutable and thread-safe.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.concurrent.ConcurrentMap<java.lang.String,java.lang.Object>FORMATTER_CACHECache of formatters.
-
Constructor Summary
Constructors Constructor Description SimpleDateTimeFormatStyleProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private intconvertStyle(FormatStyle style)Converts the enum style to the old format style.java.util.Locale[]getAvailableLocales()Gets the available locales.DateTimeFormattergetFormatter(FormatStyle dateStyle, FormatStyle timeStyle, Chronology chrono, java.util.Locale locale)Gets a localized date, time or date-time formatter.-
Methods inherited from class org.threeten.bp.format.DateTimeFormatStyleProvider
getInstance
-
-
-
-
Method Detail
-
getAvailableLocales
public java.util.Locale[] getAvailableLocales()
Description copied from class:DateTimeFormatStyleProviderGets the available locales.- Overrides:
getAvailableLocalesin classDateTimeFormatStyleProvider- Returns:
- the locales
-
getFormatter
public DateTimeFormatter getFormatter(FormatStyle dateStyle, FormatStyle timeStyle, Chronology chrono, java.util.Locale locale)
Description copied from class:DateTimeFormatStyleProviderGets a localized date, time or date-time formatter.The formatter will be the most appropriate to use for the date and time style in the locale. For example, some locales will use the month name while others will use the number.
- Specified by:
getFormatterin classDateTimeFormatStyleProvider- Parameters:
dateStyle- the date formatter style to obtain, null to obtain a time formattertimeStyle- the time formatter style to obtain, null to obtain a date formatterchrono- the chronology to use, not nulllocale- the locale to use, not null- Returns:
- the date-time formatter, not null
-
convertStyle
private int convertStyle(FormatStyle style)
Converts the enum style to the old format style.- Parameters:
style- the enum style, not null- Returns:
- the int style
-
-