Package org.silverpeas.core.calendar
Class DayOfWeekOccurrence
- java.lang.Object
-
- org.silverpeas.core.calendar.DayOfWeekOccurrence
-
- All Implemented Interfaces:
Serializable
@Embeddable public class DayOfWeekOccurrence extends Object implements Serializable
The occurrence of a day of week represents the nth occurrence of a day of week in a month or in a year within a recurrence rule of aPlannableOnCalendar
object. For example, the third tuesday in the month.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static int
ALL_OCCURRENCES
A constant that defines a specific value for all the occurrences of the represented day of week in a week, a month or a year.static int
LAST_DAY
A constant that defines a specific value for the last day according to the recurrence rule.
-
Constructor Summary
Constructors Modifier Constructor Description protected
DayOfWeekOccurrence()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DayOfWeekOccurrence
all(DayOfWeek dayOfWeek)
Creates an instance of DayOfWeekOccurrence representing all the occurrences of the specified day of week in a week, in a month or in a year.DayOfWeek
dayOfWeek()
Gets the day of week of this occurrence.boolean
equals(Object o)
int
hashCode()
int
nth()
Gets the nth this occurrence is.static DayOfWeekOccurrence
nth(int nth, DayOfWeek dayOfWeek)
Creates an instance of DayOfWeekOccurrence representing the nth occurrence of the specified day of week in a month or in a year.
-
-
-
Field Detail
-
ALL_OCCURRENCES
public static final int ALL_OCCURRENCES
A constant that defines a specific value for all the occurrences of the represented day of week in a week, a month or a year.- See Also:
- Constant Field Values
-
LAST_DAY
public static final int LAST_DAY
A constant that defines a specific value for the last day according to the recurrence rule. For example, for a monthly recurrence the last monday of each month.- See Also:
- Constant Field Values
-
-
Method Detail
-
nth
public static DayOfWeekOccurrence nth(int nth, DayOfWeek dayOfWeek)
Creates an instance of DayOfWeekOccurrence representing the nth occurrence of the specified day of week in a month or in a year.- Parameters:
nth
- a positive number indicating the nth occurrence of the specified day of week, id est the nth occurrence of the day of week encountered in the month or in the year.dayOfWeek
- the day of week.- Returns:
- a DayOfWeekOccurrence instance.
-
all
public static DayOfWeekOccurrence all(DayOfWeek dayOfWeek)
Creates an instance of DayOfWeekOccurrence representing all the occurrences of the specified day of week in a week, in a month or in a year.- Parameters:
dayOfWeek
- the day of week.- Returns:
- a DayOfWeekOccurrence instance.
-
dayOfWeek
public DayOfWeek dayOfWeek()
Gets the day of week of this occurrence.- Returns:
- the day of week.
-
nth
public int nth()
Gets the nth this occurrence is.- Returns:
- the nth occurrence or ALL_OCCURRENCES if all of the underlying day of week are considered.
-
-