|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dk.netarkivet.harvester.datamodel.Frequency dk.netarkivet.harvester.datamodel.WeeklyFrequency
public class WeeklyFrequency
This class implements a frequency of a number of weeks.
Constructor Summary | |
---|---|
WeeklyFrequency(int numUnits)
Create a new weekly frequency that happens every numUnits weeks, anytime. |
|
WeeklyFrequency(int numUnits,
int dayOfWeek,
int hour,
int minute)
Create a new weekly frequency that happens every numUnits days, on the given day of week, hour, and minute. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object o)
Autogenerated equals. |
int |
getDayOfWeek()
If not anytime, the day in the week at which events should start. |
java.util.Date |
getFirstEvent(java.util.Date startTime)
Given a starting time, tell us when the first event should happen. |
int |
getHour()
If not anytime, the hour at which events should start. |
int |
getMinute()
If not anytime, the minute at which events should start. |
java.util.Date |
getNextEvent(java.util.Date lastEvent)
Given when the last event happened, tell us when the next event should happen (even if the new event is in the past). |
java.lang.Integer |
getOnDayOfMonth()
Return the exact day of month event should happen on, or null if this is an anyTime event or doesn't define what day of month it should happen on. |
java.lang.Integer |
getOnDayOfWeek()
Return the exact day of week event should happen on, or null if this is an anyTime event or doesn't define what day of week it should happen on. |
java.lang.Integer |
getOnHour()
Return the exact hour event should happen on, or null if this is an anyTime event or doesn't define what hour it should happen on. |
java.lang.Integer |
getOnMinute()
Return the exact minute this event should happen on, or null if this is an anyTime event or doesn't define what minute it should happen on. |
int |
hashCode()
Autogenerated hashcode method. |
int |
ordinal()
Return an integer that can be used to identify the kind of frequency. |
java.lang.String |
toString()
Human readable representation of this object. |
Methods inherited from class dk.netarkivet.harvester.datamodel.Frequency |
---|
getNewInstance, getNumUnits, isAnytime |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public WeeklyFrequency(int numUnits)
numUnits
- Number of weeks from event to event.
ArgumentNotValid
- if numUnits if 0 or negativepublic WeeklyFrequency(int numUnits, int dayOfWeek, int hour, int minute)
numUnits
- Number of days from event to event.dayOfWeek
- Which day of the week this event should happen. Sunday
is day 1 of the week.hour
- The hour on which the event should happen.minute
- The minute of hour on which the event should happen.
ArgumentNotValid
- if numUnits if 0 or negative
or dayOfWeek <1=SUNDAY >7=SATURDAY
or hour is <0 or >23 or minutes is <0 or >59Method Detail |
---|
public java.util.Date getNextEvent(java.util.Date lastEvent)
getNextEvent
in class Frequency
lastEvent
- A time from which the next event should be calculated.
public java.util.Date getFirstEvent(java.util.Date startTime)
getFirstEvent
in class Frequency
startTime
- The earliest time the event can happen.
public int getMinute()
public int getHour()
public int getDayOfWeek()
public boolean equals(java.lang.Object o)
equals
in class Frequency
o
- The object to compare with
public int hashCode()
hashCode
in class Frequency
public java.lang.Integer getOnMinute()
getOnMinute
in class Frequency
public java.lang.Integer getOnHour()
getOnHour
in class Frequency
public java.lang.Integer getOnDayOfWeek()
getOnDayOfWeek
in class Frequency
public java.lang.Integer getOnDayOfMonth()
getOnDayOfMonth
in class Frequency
public int ordinal()
ordinal
in class Frequency
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |