public final class CountSchedule extends AbstractSchedule implements java.io.Serializable
If there is more than one count in a schedule a key must be provided to differentiate their internally store numbers, otherwise the count value would be shared.
If the nested schedule isn't specified it defaults to
NowSchedule
<schedules:count count="5" xmlns:schedules="http://rgordon.co.uk/oddjob/schedules"> <refinement> <schedules:interval interval="00:15"/> </refinement> </schedules:count>
<schedules:daily xmlns:schedules="http://rgordon.co.uk/oddjob/schedules"> <refinement> <schedules:time from="11:00"> <refinement> <schedules:count count="3"> <refinement> <schedules:interval interval="00:05"/> </refinement> </schedules:count> </refinement> </schedules:time> </refinement> </schedules:daily>
<schedules:count identifier="outer" count="6" xmlns:schedules="http://rgordon.co.uk/oddjob/schedules"> <refinement> <schedules:daily from="11:00"> <refinement> <schedules:count count="2"> <refinement> <schedules:interval interval="00:01"/> </refinement> </schedules:count> </refinement> </schedules:daily> </refinement> </schedules:count>
Constructor and Description |
---|
CountSchedule()
Bean constructor.
|
CountSchedule(int countTo)
Constructor with count.
|
Modifier and Type | Method and Description |
---|---|
int |
getCount()
Get the number to count to.
|
java.lang.String |
getIdentifier()
Getter for key.
|
ScheduleResult |
nextDue(ScheduleContext context)
For a given date a schedule will provide the interval this schedule
should next be scheduled in.
|
void |
setCount(int count)
Set the number to count to.
|
void |
setIdentifier(java.lang.String key)
Setter for key.
|
java.lang.String |
toString()
Override toString to be more meaningful.
|
getRefinement, setRefinement
public CountSchedule()
public CountSchedule(int countTo)
countTo
- public void setCount(int count)
count
- The number to count to.public int getCount()
public java.lang.String getIdentifier()
public void setIdentifier(java.lang.String key)
key
- public ScheduleResult nextDue(ScheduleContext context)
Schedule
If the schedule is never due again for the given date, null is returned.
public java.lang.String toString()
toString
in class java.lang.Object