Package org.elasticsearch.common.time
Class IsoCalendarDataProvider
java.lang.Object
java.util.spi.LocaleServiceProvider
java.util.spi.CalendarDataProvider
org.elasticsearch.common.time.IsoCalendarDataProvider
public class IsoCalendarDataProvider
extends java.util.spi.CalendarDataProvider
This class is loaded by JVM SPI mechanism in order to provide ISO compatible behaviour for week calculations using java.time.
It defines start of the week as Monday and requires 4 days in the first week of the year.
This class overrides default behaviour for Locale.ROOT (start of the week Sunday, minimum 1 day in the first week of the year).
Java SPI mechanism requires java.locale.providers to contain SPI value (i.e. java.locale.providers=SPI,COMPAT)
- See Also:
- ISO week date
-
Constructor Summary
Constructors Constructor Description IsoCalendarDataProvider()
-
Method Summary
Modifier and Type Method Description java.util.Locale[]
getAvailableLocales()
int
getFirstDayOfWeek(java.util.Locale locale)
int
getMinimalDaysInFirstWeek(java.util.Locale locale)
Methods inherited from class java.util.spi.LocaleServiceProvider
isSupportedLocale
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
IsoCalendarDataProvider
public IsoCalendarDataProvider()
-
-
Method Details
-
getFirstDayOfWeek
public int getFirstDayOfWeek(java.util.Locale locale)- Specified by:
getFirstDayOfWeek
in classjava.util.spi.CalendarDataProvider
-
getMinimalDaysInFirstWeek
public int getMinimalDaysInFirstWeek(java.util.Locale locale)- Specified by:
getMinimalDaysInFirstWeek
in classjava.util.spi.CalendarDataProvider
-
getAvailableLocales
public java.util.Locale[] getAvailableLocales()- Specified by:
getAvailableLocales
in classjava.util.spi.LocaleServiceProvider
-