org.oddjob.schedules.schedules
Class OccurrenceSchedule

java.lang.Object
  extended by org.oddjob.schedules.AbstractSchedule
      extended by 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

Constructor Summary
OccurrenceSchedule()
           
 
Method Summary
 String getOccurrence()
          Return the number of the occurrence for this schedule.
 ScheduleResult nextDue(ScheduleContext context)
          Return the next due interval which is the given occurrence of it's child schedules.
 void setOccurrence(String occurrence)
          Set the number of the occurrence for this schedule.
 String toString()
          Override toString.
 
Methods inherited from class org.oddjob.schedules.AbstractSchedule
getRefinement, setRefinement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OccurrenceSchedule

public OccurrenceSchedule()
Method Detail

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