|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.itim.scheduling.RecurringTimeSchedule
public class RecurringTimeSchedule
RecurringTimeSchedule is a class used to represent a recurring time
that can be used for scheduling when implementing the Schedulable
interface. This class has the flexibility to define the time based on
hours, minutes, month, day of the week, day of the month, quarterly, and
semi-annually.
The following values are the example values for the different typs of schedules(all the
remaining values of the schedule should be set to 0)
Constructor Summary | |
---|---|
RecurringTimeSchedule(int minute,
int hour,
int dayOfMonth,
int month,
int dayOfWeek)
Constructs the RecurringTimeSchedule with the given schedule parameters. |
|
RecurringTimeSchedule(int minute,
int hour,
int dayOfMonth,
int month,
int dayOfWeek,
int dayOfQuarter,
int dayOfSemiAnnual)
Constructs the RecurringTimeSchedule with the given schedule parameters. |
Method Summary | |
---|---|
int |
getDayOfMonth()
Returns the day of the month of the RecurringTimeSchedule. |
int |
getDayOfQuarter()
Returns the day of the quarter of the RecurringTimeSchedule. |
int |
getDayOfSemiAnnual()
Returns the day of the semi-annual of the RecurringTimeSchedule. |
int |
getDayOfWeek()
Returns the day of the week of the RecurringTimeSchedule. |
int |
getHour()
Returns the hour of the RecurringTimeSchedule. |
int |
getMinute()
Returns the minute of the RecurringTimeSchedule. |
int |
getMonth()
Returns the month of the RecurringTimeSchedule. |
java.util.TimeZone |
getTimeZone()
Returns the timezone that the schedule is configured with. |
boolean |
isDaily()
Method to check if the schedule is daily. |
boolean |
isHourly()
Method to check if the schedule is hourly. |
boolean |
isMinutely()
Method to check if the schedule is minutely. |
boolean |
isMonthly()
Method to check if the schedule is monthly. |
boolean |
isQuarterly()
Method to check if the schedule is quarterly. |
boolean |
isSemiAnnually()
Method to check if the schedule is semi-annually. |
boolean |
isWeekly()
Method to check if the schedule is weekly. |
long |
schedule(long time)
Returns the next scheduled date in milliseconds since the epoch. |
void |
setDayOfMonth(int dayOfMonth)
Changes the day of the month of the RecurringTimeSchedule. |
void |
setDayOfQuarter(int dayOfQuarter)
Changes the day of the quarter of the RecurringTimeSchedule. |
void |
setDayOfSemiAnnual(int dayOfSemiAnnual)
Changes the day of the semi-annual of the RecurringTimeSchedule. |
void |
setDayOfWeek(int dayOfWeek)
Changes the day of the week of the RecurringTimeSchedule. |
void |
setHour(int hour)
Changes the hour of the RecurringTimeSchedule. |
void |
setMinute(int minute)
Changes the minute of the RecurringTimeSchedule. |
void |
setMonth(int month)
Changes the month of the RecurringTimeSchedule. |
void |
setTimeZone(java.util.TimeZone timeZone)
Method to set the schedule time zone. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RecurringTimeSchedule(int minute, int hour, int dayOfMonth, int month, int dayOfWeek)
minute
- minute of the schedule. Allowed values are 0-59.hour
- hour of the schedule. Allowed values are 0-23.dayOfMonth
- day of month of the schedule (-1 if every day). This attribute
is exclusive with dayOfWeek. To set the dayOfMonth value other
than -1(daily), the month value must be set either to
specific month or -1(monthly). Allowed values are 1-28, if the schedule
is set to monthly otherwise the allowed value varies
according to the month value.month
- month of the alarm (-1 if every month). Allowed
values are 1-12 (1 = January, 2 = February, ...).dayOfWeek
- day of week of the alarm (-1 if every day).
This attribute is exclusive with dayOfMonth.
Allowed values are 1-7 (1 = Sunday, 2 = Monday,
...). java.util.Calendar constants can be
used.public RecurringTimeSchedule(int minute, int hour, int dayOfMonth, int month, int dayOfWeek, int dayOfQuarter, int dayOfSemiAnnual)
minute
- minute of the schedule. Allowed values are 0-59.hour
- hour of the schedule. Allowed values are 0-23.dayOfMonth
- day of month of the schedule (-1 if every day). This attribute
is exclusive with dayOfWeek. To set the dayOfMonth value other
than -1(daily), the month value should be set either to a
specific month or -1(monthly). Allowed values are 1-28, if schedule
is set to monthly, otherwise the allowed value varies
according to the month value.month
- month of the alarm (-1 if every month). Allowed
values are 1-12 (1 = January, 2 = February, ...).dayOfWeek
- day of week of the alarm (-1 if every day).
This attribute is exclusive with dayOfMonth.
Allowed values are 1-7 (1 = Sunday, 2 = Monday,
...). java.util.Calendar constants can be
used.dayOfQuarter
- (0 for disabled by quarterly, otherwise 1-90)
dayOfQuarter is exclusive with dayOfMonth, dayOfWeek and dayOfSemiAnnual,
therefore value of dayOfMonth, dayOfWeek and dayOfSemiAnnual
is set to ignore.dayOfSemiAnnual
- (0 for disabled by semi-annually, otherwise 1-180)
dayOfSemiAnnual is exclusive with dayOfMonth, dayOfWeek and
dayOfQuarter therefore value of dayOfMonth, dayOfWeek and
dayOfQuarter is set to ignore.Method Detail |
---|
public int getMinute()
public void setMinute(int minute)
minute
- new minute to configure. Allowed values are 0-59.
java.lang.IllegalArgumentException
- Thrown if argument is not within the range.public int getHour()
public void setHour(int hour)
hour
- new hour to configure. Allowed values are 0-23. (-1 if every hour.)
java.lang.IllegalArgumentException
- Thrown if argument is not within the range.public int getMonth()
public void setMonth(int month)
month
- new month to configure (-1 if every month). (0 if ignore)
Allowed values are 0-12 (1 = January, 2 = February,
...).
java.lang.IllegalArgumentException
- Thrown if argument is not within the range.public int getDayOfWeek()
public void setDayOfWeek(int dayOfWeek)
dayOfWeek
- new day of the week to configure (-1 if every
day) (0 if ignore). This attribute is exclusive with
dayOfMonth. Allowed values are 1-7 (1 = Sunday,
2 = Monday, ...). java.util.Calendar
constants can be used.
java.lang.IllegalArgumentException
- Thrown if argument is not within the range.public void setDayOfQuarter(int dayOfQuarter)
dayOfQuarter
- day of the quarter(0 for disabled by quarterly, otherwise 1-90).
java.lang.IllegalArgumentException
- Thrown if argument is not within the range.public int getDayOfQuarter()
public void setDayOfSemiAnnual(int dayOfSemiAnnual)
dayOfSemiAnnual
- day of the semi-annual(0 for disabled by semi-annually, otherwise 1-180).
java.lang.IllegalArgumentException
- Thrown if argument is not within the range.public int getDayOfSemiAnnual()
public int getDayOfMonth()
public void setDayOfMonth(int dayOfMonth)
dayOfMonth
- new day of the month to configure (-1 if it is
every day). This attribute is exclusive with
dayOfWeek therefore value of
dayOfWeek is set to ignore. To set the dayOfMonth value other
than -1(daily), the month value must be set either to
specific month or -1(monthly). Allowed values are 1-28 if the schedule
is set to monthly. If the month value is set to the schedule,
then the value can be set according to month.
java.lang.IllegalArgumentException
- Thrown if argument is not within the range.public void setTimeZone(java.util.TimeZone timeZone)
timeZone
- public java.util.TimeZone getTimeZone()
public long schedule(long time)
schedule
in interface Schedulable
time
- the current time in milliseconds since the epoch.
public boolean isDaily()
public boolean isMonthly()
public boolean isWeekly()
public boolean isHourly()
public boolean isMinutely()
public boolean isQuarterly()
public boolean isSemiAnnually()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |