Interface OrdinalWeekdayElement<T>
- Type Parameters:
T
- generic type of calendar chronology
- All Superinterfaces:
ChronoElement<Integer>
,Comparator<ChronoDisplay>
,StdCalendarElement<Integer,T>
The element for the ordinal weekday in month.
This interface offers additional operators for setting the weekday in month.
- Since:
- 3.33/4.28
- Author:
- Meno Hochschild
-
Method Summary
Modifier and TypeMethodDescriptionDefines an operator which moves a date to the given ordinal weekday in month.setToFirst(Weekday dayOfWeek)
Defines an operator which moves a date to the first given weekday in month.Defines an operator which moves a date to the last given weekday in month.Methods inherited from interface net.time4j.engine.ChronoElement
compare, getDefaultMaximum, getDefaultMinimum, getDisplayName, getSymbol, getType, isDateElement, isLenient, isTimeElement, name
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
Methods inherited from interface net.time4j.calendar.StdCalendarElement
atCeiling, atFloor, decremented, incremented, maximized, minimized
-
Method Details
-
setToFirst
Defines an operator which moves a date to the first given weekday in month.
Equivalent to
setTo(1, dayOfWeek)
.- Parameters:
dayOfWeek
- first day of week in month- Returns:
- lenient operator
-
setToLast
Defines an operator which moves a date to the last given weekday in month.
Equivalent to
setTo(Integer.MAX_VALUE, dayOfWeek)
. The new day will never be in next month.- Parameters:
dayOfWeek
- last day of week in month- Returns:
- lenient operator
-
setTo
Defines an operator which moves a date to the given ordinal weekday in month.
If given ordinal number is
Integer.MAX_VALUE
then the last weekday in month will be determined. This operator behaves in a lenient way, any overflow of the ordinal number will be transferred to another month. Note that this behaviour will also happen if the current month might be shorter than a full calendar week as exotic edge case.- Parameters:
ordinal
- ordinal numberdayOfWeek
- last day of week in month- Returns:
- lenient operator
-