org.oddjob.schedules.schedules
Class OccurrenceSchedule
java.lang.Object
org.oddjob.schedules.AbstractSchedule
org.oddjob.schedules.schedules.OccurrenceSchedule
- All Implemented Interfaces:
- Serializable, RefineableSchedule, Schedule
public final class OccurrenceSchedule
- extends AbstractSchedule
- implements Serializable
Description
This schedule counts the occurence's
of it's nested schedule
and returns the required occurrence.Example
Second Tuesday of the month.
<schedules:monthly xmlns:schedules="http://rgordon.co.uk/oddjob/schedules">
<refinement>
<bean class="org.oddjob.schedules.schedules.OccurrenceSchedule" occurrence="2">
<refinement>
<schedules:weekly on="2"/>
</refinement>
</bean>
</refinement>
</schedules:monthly>
- See Also:
- Serialized Form
- Author:
- Rob Gordon
OccurrenceSchedule
public OccurrenceSchedule()
setOccurrence
public void setOccurrence(String occurrence)
- Set the number of the occurrence for this schedule.
- Parameters:
occurrence
- The occurence.
getOccurrence
public String getOccurrence()
- Return the number of the occurrence for this schedule.
- Returns:
- The occurrence.
nextDue
public ScheduleResult nextDue(ScheduleContext context)
- Return the next due interval which is the given occurrence of
it's child schedules.
- Specified by:
nextDue
in interface Schedule
- Returns:
- The next due interval for the schedule.
toString
public String toString()
- Override toString.
- Overrides:
toString
in class Object