Package javax.time.calendar
Class DateAdjusters.DayOfWeekInMonth
- java.lang.Object
-
- javax.time.calendar.DateAdjusters.DayOfWeekInMonth
-
- All Implemented Interfaces:
java.io.Serializable
,DateAdjuster
- Enclosing class:
- DateAdjusters
private static final class DateAdjusters.DayOfWeekInMonth extends java.lang.Object implements DateAdjuster, java.io.Serializable
Class implementing day-of-week in month adjuster.
-
-
Field Summary
Fields Modifier and Type Field Description private DayOfWeek
dayOfWeek
The day-of-week.private int
ordinal
The ordinal, from 1 to 5.private static long
serialVersionUID
A serialization identifier for this class.
-
Constructor Summary
Constructors Modifier Constructor Description private
DayOfWeekInMonth(int ordinal, DayOfWeek dayOfWeek)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LocalDate
adjustDate(LocalDate date)
Adjusts the input date returning the adjusted date.boolean
equals(java.lang.Object obj)
int
hashCode()
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
A serialization identifier for this class.- See Also:
- Constant Field Values
-
ordinal
private final int ordinal
The ordinal, from 1 to 5.
-
dayOfWeek
private final DayOfWeek dayOfWeek
The day-of-week.
-
-
Constructor Detail
-
DayOfWeekInMonth
private DayOfWeekInMonth(int ordinal, DayOfWeek dayOfWeek)
Constructor.- Parameters:
ordinal
- ordinal, from 1 to 5dayOfWeek
- the day-of-week, not null
-
-
Method Detail
-
adjustDate
public LocalDate adjustDate(LocalDate date)
Adjusts the input date returning the adjusted date.This is a strategy pattern that allows a range of adjustments to be made to a date.
- Specified by:
adjustDate
in interfaceDateAdjuster
- Parameters:
date
- the date to adjust, not null- Returns:
- the adjusted date, never null
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-