getLocalDate abstract method
- int weekYear,
- int weekOfWeekYear,
- DayOfWeek dayOfWeek,
- CalendarSystem calendar,
Creates a LocalDate from a given week-year, week within that week-year, and day-of-week, for the specified calendar system.
Wherever reasonable, implementations should ensure that all valid dates
can be constructed via this method. In other words, given a LocalDate date
,
rule.getLocalDate(rule.getWeekYear(date), rule.getWeekOfWeekYear(date), date.isoDayOfWeek, date.calendar)
should always return date
. This is true for all rules within Time Machine, but third party
implementations may choose to simplify their implementations by restricting them to appropriate portions
of time.
Implementations may restrict which calendar systems supplied here, but the implementations provided by Time Machine work with all available calendar systems.
weekYear
: The week-year of the new date. Implementations provided by Time Machine allow any year which is a valid calendar year, and sometimes one less than the minimum calendar year and/or one more than the maximum calendar year, to allow for dates near the start of a calendar year to fall in the previous week year, and similarly for dates near the end of a calendar year.weekOfWeekYear
: The week of week-year of the new date. Valid values for this parameter may vary depending onweekYear
, as the length of a year in weeks varies.dayOfWeek
: The day-of-week of the new date. Valid values for this parameter may vary depending onweekYear
andweekOfWeekYear
.calendar
: The calendar system for the date.
Returns: A LocalDate corresponding to the specified values.
- RangeError: The parameters do not combine to form a valid date.
Implementation
LocalDate getLocalDate(int weekYear, int weekOfWeekYear, DayOfWeek dayOfWeek, CalendarSystem calendar);