public final class WeeklySchedule extends ConstrainedSchedule implements java.io.Serializable
TimeSchedule
refinement property.
The days of the week are specified according to the ISO 8601 standard with Monday being day 1 and Sunday being day 7, or as one of MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY (case insensitive).
<schedules:weekly on="Tuesday" xmlns:schedules="http://rgordon.co.uk/oddjob/schedules"/>
<schedules:weekly from="Friday" to="Monday" xmlns:schedules="http://rgordon.co.uk/oddjob/schedules"> <refinement> <schedules:daily at="15:45"/> </refinement> </schedules:weekly>
Constructor and Description |
---|
WeeklySchedule() |
Modifier and Type | Method and Description |
---|---|
protected java.util.Calendar |
fromCalendar(java.util.Date referenceDate,
java.util.TimeZone timeZone)
Provide a Calendar for the start of the constraint.
|
DayOfWeek |
getFrom() |
DayOfWeek |
getTo() |
protected CalendarUnit |
intervalBetween()
Sub classes must provide a unit which is what must be
added to move the schedule on.
|
void |
setFrom(DayOfWeek from) |
void |
setOn(DayOfWeek on) |
void |
setTo(DayOfWeek to) |
protected java.util.Calendar |
toCalendar(java.util.Date referenceDate,
java.util.TimeZone timeZone)
Provide a Calendar for the end of the constraint.
|
java.lang.String |
toString()
Override toString.
|
lastInterval, nextDue, nextInterval, shiftFromCalendar, shiftToCalendar
getRefinement, setRefinement
public void setFrom(DayOfWeek from)
Property: from
Description: The from day of the week.
Required: No. Defaults to Monday.
from
- The from date.public DayOfWeek getFrom()
public void setTo(DayOfWeek to)
Property: to
Description: The to day of the week.
Required: No. Defaults to Sunday.
to
- The to day.public DayOfWeek getTo()
public void setOn(DayOfWeek on)
Property: on
Description: The on day of week. This has the same effect as setting from and to to the same thing.
Required: No.
on
- The on text.protected CalendarUnit intervalBetween()
ConstrainedSchedule
intervalBetween
in class ConstrainedSchedule
protected java.util.Calendar fromCalendar(java.util.Date referenceDate, java.util.TimeZone timeZone)
ConstrainedSchedule
fromCalendar
in class ConstrainedSchedule
referenceDate
- The date/time now.timeZone
- The time zone.protected java.util.Calendar toCalendar(java.util.Date referenceDate, java.util.TimeZone timeZone)
ConstrainedSchedule
toCalendar
in class ConstrainedSchedule
referenceDate
- The date/time now.timeZone
- The time zone.public java.lang.String toString()
toString
in class ConstrainedSchedule