public class RepeatingSchedule extends Schedule
Constructor and Description |
---|
RepeatingSchedule(Date startDate,
int repeats,
Frequency frequency,
String name,
String comments)
Create a new RepeatingSchedule that runs a given number of times.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o)
Autogenerated equals.
|
Date |
getNextEvent(Date lastEvent,
int numPreviousEvents)
Return the date at which the next event will happen.
|
int |
getRepeats()
Return how many times this schedule should be triggered.
|
int |
hashCode()
Autogenerated hashcode method.
|
String |
toString()
Human readable represenation of this object.
|
getComments, getEdition, getFirstEvent, getFrequency, getInstance, getInstance, getName, getStartDate, setComments, setEdition
public RepeatingSchedule(Date startDate, int repeats, Frequency frequency, String name, String comments)
startDate
- The time at which the schedule starts running. This is not necessarily the time of the first
event, but no events will happen before this. May be null, meaning start any time.repeats
- how many events should happen totally.frequency
- How frequently the event should happen.name
- The unique name of the schedule.comments
- Comments entered by the userArgumentNotValid
- if frequency, name or comments is null, or name is "" or repeats is 0 or negativepublic int hashCode()
public Date getNextEvent(Date lastEvent, int numPreviousEvents)
getNextEvent
in class Schedule
lastEvent
- The time at which the previous event happened.numPreviousEvents
- How many events have previously happened.ArgumentNotValid
- if numPreviousEvents is negativepublic int getRepeats()
Copyright © 2005–2015 The Royal Danish Library, the Danish State and University Library, the National Library of France and the Austrian National Library.. All rights reserved.