Interface WeekdataProvider


public interface WeekdataProvider

This SPI-interface enables the access to localized week rules and is instantiated via a ServiceLoader-mechanism.

If there is no external WeekdataProvider then Time4J will use an internal implementation which is based on all informations contained in the JDK and also the CLDR-data of unicode consortium. Especially the data which define a weekend will be preferably read from the resource file "data/weekend.data".

Note: All implementations must have a public no-arg constructor.

Author:
Meno Hochschild
See Also:
ServiceLoader
  • Method Details

    • getFirstDayOfWeek

      int getFirstDayOfWeek(Locale country)

      Defines the first day of a calendar week.

      Parameters:
      country - country or region
      Returns:
      weekday (Mon=1, Tue=2, Wed=3, Thu=4, Fri=5, Sat=6, Sun=7)
    • getMinimalDaysInFirstWeek

      int getMinimalDaysInFirstWeek(Locale country)

      Defines the minimum count of days which the first calendar week of the year or month must contain.

      Parameters:
      country - country or region
      Returns:
      int in range 1 - 7
    • getStartOfWeekend

      int getStartOfWeekend(Locale country)

      Defines the first day of weekend.

      Parameters:
      country - country or region
      Returns:
      weekday (Mon=1, Tue=2, Wed=3, Thu=4, Fri=5, Sat=6, Sun=7)
    • getEndOfWeekend

      int getEndOfWeekend(Locale country)

      Defines the last day of weekend.

      Parameters:
      country - country or region
      Returns:
      weekday (Mon=1, Tue=2, Wed=3, Thu=4, Fri=5, Sat=6, Sun=7)