Class CommonElements
Defines access to elements which can be used by all calendars defined in this package.
- Since:
- 3.20/4.16
- Author:
- Meno Hochschild
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic ChronoElement<Integer>Represents the related gregorian year which corresponds to the start of any given non-gregorian calendar year. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends ChronoEntity<T> & CalendarDate>
StdCalendarElement<Integer,T>boundedWeekOfMonth(Chronology<T> chronology, Weekmodel model)Creates an integer element for the week of month in given chronology dependent on given week model and constrained by month boundaries.static <T extends ChronoEntity<T> & CalendarDate>
StdCalendarElement<Integer,T>boundedWeekOfYear(Chronology<T> chronology, Weekmodel model)Creates an integer element for the week of year in given chronology dependent on given week model and constrained by year boundaries.static <T extends ChronoEntity<T> & CalendarDate>
StdCalendarElement<Weekday,T>localDayOfWeek(Chronology<T> chronology, Weekmodel model)Defines an element for the weekday with a localized day number in the value range1-7.static <T extends ChronoEntity<T> & CalendarDate>
StdCalendarElement<Integer,T>weekOfMonth(Chronology<T> chronology, Weekmodel model)Creates an integer element for the week of month in given chronology dependent on given week model.static <T extends ChronoEntity<T> & CalendarDate>
StdCalendarElement<Integer,T>weekOfYear(Chronology<T> chronology, Weekmodel model)Creates an integer element for the week of year in given chronology dependent on given week model.
-
Field Details
-
RELATED_GREGORIAN_YEAR
Represents the related gregorian year which corresponds to the start of any given non-gregorian calendar year.
The element is read-only.
- Since:
- 3.20/4.16
-
-
Method Details
-
localDayOfWeek
@FormattableElement(format="e", alt="c") public static <T extends ChronoEntity<T> & CalendarDate> StdCalendarElement<Weekday,T> localDayOfWeek(Chronology<T> chronology, Weekmodel model)Defines an element for the weekday with a localized day number in the value range
1-7.The given chronology must support a 7-day-week with an element of name "DAY_OF_WEEK" otherwise an exception will be thrown.
This element defines localized weekday numbers in numerical formatting and also a localized sorting order of weekdays, but still manages values of type
Weekday. However, the value range with its minimum and maximum is localized, too, i.e. the element defines as minium the valuegetFirstDayOfWeek().- Type Parameters:
T- chronological type- Parameters:
chronology- the calendrical chronologymodel- the underlying week model- Returns:
- day of week with localized order
- Throws:
IllegalArgumentException- if the chronology does not support this element- Since:
- 3.24/4.20
-
weekOfYear
@FormattableElement(format="w") public static <T extends ChronoEntity<T> & CalendarDate> StdCalendarElement<Integer,T> weekOfYear(Chronology<T> chronology, Weekmodel model)Creates an integer element for the week of year in given chronology dependent on given week model.
The given chronology must support a 7-day-week with elements of names "DAY_OF_WEEK" and "DAY_OF_YEAR", otherwise an exception will be thrown.
- Type Parameters:
T- chronological type- Parameters:
chronology- the calendrical chronologymodel- the underlying week model- Returns:
- generic calendar element
- Throws:
IllegalArgumentException- if the chronology does not support this element- Since:
- 3.24/4.20
-
weekOfMonth
@FormattableElement(format="W") public static <T extends ChronoEntity<T> & CalendarDate> StdCalendarElement<Integer,T> weekOfMonth(Chronology<T> chronology, Weekmodel model)Creates an integer element for the week of month in given chronology dependent on given week model.
The given chronology must support a 7-day-week with elements of names "DAY_OF_WEEK" and "DAY_OF_MONTH", otherwise an exception will be thrown.
- Type Parameters:
T- chronological type- Parameters:
chronology- the calendar chronologymodel- the underlying week model- Returns:
- generic calendar element
- Throws:
IllegalArgumentException- if the chronology does not support this element- Since:
- 3.24/4.20
-
boundedWeekOfYear
public static <T extends ChronoEntity<T> & CalendarDate> StdCalendarElement<Integer,T> boundedWeekOfYear(Chronology<T> chronology, Weekmodel model)Creates an integer element for the week of year in given chronology dependent on given week model and constrained by year boundaries.
The given chronology must support a 7-day-week with elements of names "DAY_OF_WEEK" and "DAY_OF_YEAR", otherwise an exception will be thrown.
- Type Parameters:
T- chronological type- Parameters:
chronology- the calendrical chronologymodel- the underlying week model- Returns:
- generic calendar element
- Throws:
IllegalArgumentException- if the chronology does not support this element- Since:
- 3.40/4.35
-
boundedWeekOfMonth
public static <T extends ChronoEntity<T> & CalendarDate> StdCalendarElement<Integer,T> boundedWeekOfMonth(Chronology<T> chronology, Weekmodel model)Creates an integer element for the week of month in given chronology dependent on given week model and constrained by month boundaries.
The given chronology must support a 7-day-week with elements of names "DAY_OF_WEEK" and "DAY_OF_MONTH", otherwise an exception will be thrown.
- Type Parameters:
T- chronological type- Parameters:
chronology- the calendar chronologymodel- the underlying week model- Returns:
- generic calendar element
- Throws:
IllegalArgumentException- if the chronology does not support this element- Since:
- 3.40/4.35
-