Package javax.time.calendar
Class DateAdjusters.RelativeDayOfWeek
- java.lang.Object
-
- javax.time.calendar.DateAdjusters.RelativeDayOfWeek
-
- All Implemented Interfaces:
java.io.Serializable
,DateAdjuster
- Enclosing class:
- DateAdjusters
private static final class DateAdjusters.RelativeDayOfWeek extends java.lang.Object implements DateAdjuster, java.io.Serializable
Implementation of next, previous or current day-of-week.
-
-
Field Summary
Fields Modifier and Type Field Description private DayOfWeek
dow
The day-of-week to find.private int
relative
Whether the current date is a valid answer.private static long
serialVersionUID
A serialization identifier for this class.
-
Constructor Summary
Constructors Modifier Constructor Description private
RelativeDayOfWeek(int relative, DayOfWeek dow)
-
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
-
relative
private final int relative
Whether the current date is a valid answer.
-
dow
private final DayOfWeek dow
The day-of-week to find.
-
-
Constructor Detail
-
RelativeDayOfWeek
private RelativeDayOfWeek(int relative, DayOfWeek dow)
-
-
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
-
-