|
Compoze Software, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.compoze.exchange.TaskRecurrencePattern
This class is used to represent the recurrence pattern for a task. Recurring Tasks have the ability to regenerate themselves. This functionality is available for Daily, Weekly, Monthly and Yearly tasks, but not Monthly Nth or Yearly Nth. Specifying a regenerative task will force an initially calculated end date, discarding any specified date, since the end date becomes variable.
Recurrence patterns are not necessarily static upon calling any of the createXXX methods. After a pattern is created, it is internally normalized. This is done because the recurrence pattern must contain fields for number of occurrences and end date, even if those fields are not used directly by the pattern. Normalization also adjusts start pattern start dates to make sure it falls on the pattern. So for example, creating a weekly pattern with a start date on Tuesday with a day mask of Wednesday will alter the start date to the next available Wednesday to match the pattern.
Additionally, if creating a monthly or yearly pattern with DayOfMonth or MonthOfYear set
to zero, those fields will be reset to the day or month of the pattern start date. In
other words, calling getDayOfMonth()
will not return zero.
Field Summary | |
static TaskRecurrencePattern |
NONE
This constant represents no recurrence, and may be passed in to clear the recurrence pattern on an existing task. |
Method Summary | |
static TaskRecurrencePattern |
createDaily(java.util.Date startDate,
java.util.Date endDate,
int iInterval)
Creates a daily recurring task with an end date. |
static TaskRecurrencePattern |
createDaily(java.util.Date startDate,
int iInterval)
Creates a daily recurring task with no end date. |
static TaskRecurrencePattern |
createDaily(java.util.Date startDate,
int iInterval,
int iOccurrences)
Creates a daily recurrence pattern for a number of occurrences. |
static TaskRecurrencePattern |
createDailyRegenerate(java.util.Date startDate,
int iRegenerate)
Creates a regenerating daily recurrence pattern with no end date. |
static TaskRecurrencePattern |
createDailyRegenerate(java.util.Date startDate,
int iRegenerate,
int iOccurrences)
Creates a regenerating daily recurrence pattern for a number of occurrences. |
static TaskRecurrencePattern |
createMonthly(java.util.Date startDate,
java.util.Date endDate,
int iDayOfMonth,
int iInterval)
Creates a monthly recurrence pattern with an end date. |
static TaskRecurrencePattern |
createMonthly(java.util.Date startDate,
int iDayOfMonth,
int iInterval)
Creates a monthly recurring task with no end date. |
static TaskRecurrencePattern |
createMonthly(java.util.Date startDate,
int iDayOfMonth,
int iInterval,
int iOccurrences)
Creates a monthly recurrence pattern for a number of occurrences. |
static TaskRecurrencePattern |
createMonthlyNth(java.util.Date startDate,
java.util.Date endDate,
RecurrenceInstance instance,
DaysOfWeek daysOfWeek,
int iInterval)
Creates a monthly nth recurrence pattern with an end date. |
static TaskRecurrencePattern |
createMonthlyNth(java.util.Date startDate,
RecurrenceInstance instance,
DaysOfWeek daysOfWeek,
int iInterval)
Creates a monthly nth recurrence pattern with no end date. |
static TaskRecurrencePattern |
createMonthlyNth(java.util.Date startDate,
RecurrenceInstance instance,
DaysOfWeek daysOfWeek,
int iInterval,
int iOccurrences)
Creates a monthly nth recurrence pattern for occurrences. |
static TaskRecurrencePattern |
createMonthlyRegenerate(java.util.Date startDate,
int iRegenerate)
Creates a regenerative monthly recurrence pattern with no end date. |
static TaskRecurrencePattern |
createMonthlyRegenerate(java.util.Date startDate,
int iRegenerate,
int iOccurrences)
Creates a regenerative monthly recurrence pattern with occurrences. |
static TaskRecurrencePattern |
createWeekly(java.util.Date startDate,
java.util.Date endDate,
DaysOfWeek daysOfWeek,
int iInterval)
Creates a weekly recurrence pattern with an end date. |
static TaskRecurrencePattern |
createWeekly(java.util.Date startDate,
DaysOfWeek daysOfWeek,
int iInterval)
Creates a weekly recurrence pattern with no end date. |
static TaskRecurrencePattern |
createWeekly(java.util.Date startDate,
DaysOfWeek daysOfWeek,
int iInterval,
int iOccurrences)
Creates a weekly recurrence pattern for a number of occurrences. |
static TaskRecurrencePattern |
createWeeklyRegenerate(java.util.Date startDate,
int iRegenerate)
Creates a regenerative weekly recurrence pattern with no end date. |
static TaskRecurrencePattern |
createWeeklyRegenerate(java.util.Date startDate,
int iRegenerate,
int iOccurrences)
Creates a regenerative weekly recurrence pattern for a number of occurrences. |
static TaskRecurrencePattern |
createYearly(java.util.Date startDate,
java.util.Date endDate,
int iMonthOfYear,
int iDayOfMonth)
Creates a yearly task recurrence pattern with an end date. |
static TaskRecurrencePattern |
createYearly(java.util.Date startDate,
int iMonthOfYear,
int iDayOfMonth)
Creates a yearly task recurrence pattern with no end date. |
static TaskRecurrencePattern |
createYearly(java.util.Date startDate,
int iMonthOfYear,
int iDayOfMonth,
int iOccurrences)
Creates a yearly task recurrence pattern ending for a number of occurrences. |
static TaskRecurrencePattern |
createYearlyNth(java.util.Date startDate,
java.util.Date endDate,
RecurrenceInstance instance,
DaysOfWeek daysOfWeek,
int iMonthOfYear)
Creates a yearly nth recurrence pattern with an end date. |
static TaskRecurrencePattern |
createYearlyNth(java.util.Date startDate,
RecurrenceInstance instance,
DaysOfWeek daysOfWeek,
int iMonthOfYear)
Creates a yearly nth recurrence pattern with no end date. |
static TaskRecurrencePattern |
createYearlyNth(java.util.Date startDate,
RecurrenceInstance instance,
DaysOfWeek daysOfWeek,
int iMonthOfYear,
int iOccurrences)
Creates a yearly nth recurrence pattern with a number of occurrences. |
static TaskRecurrencePattern |
createYearlyRegenerate(java.util.Date startDate,
int iRegenerate)
Creates a regenerating yearly recurrence pattern with no end date. |
static TaskRecurrencePattern |
createYearlyRegenerate(java.util.Date startDate,
int iRegenerate,
int iOccurrences)
Creates a regenerating yearly recurrence pattern with a number of occurrences. |
boolean |
equals(java.lang.Object o)
Compares equality of two patterns. |
int |
getDayOfMonth()
Gets the day of the month for the pattern (only valid for RecurrenceType.MONTHLY and RecurrenceType.YEARLY ) |
DaysOfWeek |
getDaysOfWeek()
Gets the days of the week mask for the recurrence (only valid for RecurrenceType.WEEKLY , RecurrenceType.MONTHLY_NTH and
RecurrenceType.YEARLY_NTH ). |
RecurrenceInstance |
getInstance()
Gets the instance of the day within the period (only valid for RecurrenceType.MONTHLY_NTH and RecurrenceType.YEARLY_NTH ). |
int |
getInterval()
Gets the number of recurrence units between instances. |
int |
getMonthOfYear()
Gets the month of year for the pattern (only valid for types RecurrenceType.YEARLY and RecurrenceType.YEARLY_NTH ). |
int |
getOccurrences()
Gets the number of occurrences in the pattern. |
java.util.Date |
getPatternEndDate()
Gets the date of the last recurring task. |
java.util.Date |
getPatternStartDate()
Gets the date of the first recurring task. |
RecurrenceType |
getRecurrenceType()
Gets the type of the recurrence. |
int |
getRegenerate()
Gets the regeneration interval for the pattern type. |
boolean |
hasNoEndDate()
Gets whether the pattern has an end date. |
boolean |
isRegenerating()
Returns if this pattern is regenerative. |
java.lang.String |
toString()
Gets the string representation of the pattern. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final TaskRecurrencePattern NONE
Method Detail |
public static TaskRecurrencePattern createDaily(java.util.Date startDate, int iInterval)
startDate
- the start date of the taskiInterval
- the number of days between recurrencespublic static TaskRecurrencePattern createDaily(java.util.Date startDate, java.util.Date endDate, int iInterval)
startDate
- the start date of the taskendDate
- the end date of the task (or null
if the pattern
has no end)iInterval
- the number of days between recurrencespublic static TaskRecurrencePattern createDaily(java.util.Date startDate, int iInterval, int iOccurrences)
startDate
- the start date of the taskiInterval
- the number of days between recurrencesiOccurrences
- the number of times the task recurs (greater or equal
to one)public static TaskRecurrencePattern createDailyRegenerate(java.util.Date startDate, int iRegenerate, int iOccurrences)
startDate
- the start date of the taskiRegenerate
- the number of days between recurrencesiOccurrences
- the number of times the task recurs (greater or equal
to one)public static TaskRecurrencePattern createDailyRegenerate(java.util.Date startDate, int iRegenerate)
startDate
- the start date of the taskiRegenerate
- the number of days between recurrencespublic static TaskRecurrencePattern createWeekly(java.util.Date startDate, DaysOfWeek daysOfWeek, int iInterval)
startDate
- the start date of the taskdaysOfWeek
- the days of week to recur (or null
to use
the day of the week of the start date)iInterval
- the number of weeks between recurrencespublic static TaskRecurrencePattern createWeekly(java.util.Date startDate, java.util.Date endDate, DaysOfWeek daysOfWeek, int iInterval)
startDate
- the start date of the taskendDate
- the end date of the task (or null
if the pattern
has no end)daysOfWeek
- the days of week to recur (or null
to use
the day of the week of the start date)iInterval
- the number of weeks between recurrencespublic static TaskRecurrencePattern createWeekly(java.util.Date startDate, DaysOfWeek daysOfWeek, int iInterval, int iOccurrences)
startDate
- the start date of the taskdaysOfWeek
- the days of week to recur (or null
to use
the day of the week of the start date)iInterval
- the number of weeks between recurrencesiOccurrences
- the number of times the task recurs (greater or equal
to one)public static TaskRecurrencePattern createWeeklyRegenerate(java.util.Date startDate, int iRegenerate, int iOccurrences)
startDate
- the start date of the taskiRegenerate
- the interval at which to regenerate the task (any number but
zero will cancel out any setting for endDate
)iOccurrences
- the number of times the task recurs (greater or equal
to one)public static TaskRecurrencePattern createWeeklyRegenerate(java.util.Date startDate, int iRegenerate)
startDate
- the start date of the taskiRegenerate
- the interval at which to regenerate the task (must be greater
than zero)public static TaskRecurrencePattern createMonthly(java.util.Date startDate, int iDayOfMonth, int iInterval)
startDate
- the start date of the taskiDayOfMonth
- the day of the month to recur (or 0
to use
the day of the month of the start date)iInterval
- the number of months between recurrencespublic static TaskRecurrencePattern createMonthly(java.util.Date startDate, java.util.Date endDate, int iDayOfMonth, int iInterval)
startDate
- the start date of the taskendDate
- the end date of the task (or null
if the pattern
has no end)iDayOfMonth
- the day of the month to recur (or 0
to use
the day of the month of the start date)iInterval
- the number of months between recurrencespublic static TaskRecurrencePattern createMonthly(java.util.Date startDate, int iDayOfMonth, int iInterval, int iOccurrences)
startDate
- the start date of the taskiDayOfMonth
- the day of the month to recur (or 0
to use
the day of the month of the start date)iInterval
- the number of months between recurrencesiOccurrences
- the number of times the task recurs (greater or equal
to one)public static TaskRecurrencePattern createMonthlyRegenerate(java.util.Date startDate, int iRegenerate)
startDate
- the start date of the taskiRegenerate
- the interval at which to regenerate the task (any number but
zero will cancel out any setting for endDate
)public static TaskRecurrencePattern createMonthlyRegenerate(java.util.Date startDate, int iRegenerate, int iOccurrences)
startDate
- the start date of the taskiRegenerate
- the interval at which to regenerate the task (any number but
zero will cancel out any setting for endDate
)iOccurrences
- the number of times the task recurs (greater or equal
to one)public static TaskRecurrencePattern createMonthlyNth(java.util.Date startDate, RecurrenceInstance instance, DaysOfWeek daysOfWeek, int iInterval)
startDate
- the start date of the taskiInstance
- the instance of the days of the week that the task recursdaysOfWeek
- the days of week (or null
to use the day of the
week of the start date)iInterval
- the number of months between recurrencespublic static TaskRecurrencePattern createMonthlyNth(java.util.Date startDate, RecurrenceInstance instance, DaysOfWeek daysOfWeek, int iInterval, int iOccurrences)
startDate
- the start date of the taskiInstance
- the instance of the days of the week that the task recursdaysOfWeek
- the days of week (or null
to use the day of the
week of the start date)iInterval
- the number of months between recurrencesiOccurrences
- the number of times the task recurs (greater or equal
to one)public static TaskRecurrencePattern createMonthlyNth(java.util.Date startDate, java.util.Date endDate, RecurrenceInstance instance, DaysOfWeek daysOfWeek, int iInterval)
startDate
- the start date of the taskendDate
- the end date of the task (or null
if the pattern
has no end)iInstance
- the instance of the days of the week that the task recursdaysOfWeek
- the days of week (or null
to use the day of the
week of the start date)iInterval
- the number of months between recurrencespublic static TaskRecurrencePattern createYearly(java.util.Date startDate, int iMonthOfYear, int iDayOfMonth)
startDate
- the start date of the taskiMonthOfYear
- the month of the year to recur (or 0
to use
the month of the year of the start date)iDayOfMonth
- the day of the month to recur (or 0
to use
the day of the month of the start date)public static TaskRecurrencePattern createYearly(java.util.Date startDate, java.util.Date endDate, int iMonthOfYear, int iDayOfMonth)
startDate
- the start date of the taskendDate
- the end date of the task (or null
if the pattern
has no end)iMonthOfYear
- the month of the year to recur (or 0
to use
the month of the year of the start date)iDayOfMonth
- the day of the month to recur (or 0
to use
the day of the month of the start date)public static TaskRecurrencePattern createYearly(java.util.Date startDate, int iMonthOfYear, int iDayOfMonth, int iOccurrences)
startDate
- the start date of the taskiMonthOfYear
- the month of the year to recur (or 0
to use
the month of the year of the start date)iDayOfMonth
- the day of the month to recur (or 0
to use
the day of the month of the start date)iOccurrences
- the number of times the task recurs (greater or equal
to one)public static TaskRecurrencePattern createYearlyRegenerate(java.util.Date startDate, int iRegenerate)
startDate
- the start date of the taskiRegenerate
- the interval at which to regenerate the task (any number but
zero will cancel out any setting for endDate
)public static TaskRecurrencePattern createYearlyRegenerate(java.util.Date startDate, int iRegenerate, int iOccurrences)
startDate
- the start date of the taskiRegenerate
- the interval at which to regenerate the task (any number but
zero will cancel out any setting for endDate
)iOccurrences
- the number of times the task recurs (greater or equal
to one)public static TaskRecurrencePattern createYearlyNth(java.util.Date startDate, RecurrenceInstance instance, DaysOfWeek daysOfWeek, int iMonthOfYear)
startDate
- the start date of the taskinstance
- the instance of the days of the week that the task recursdaysOfWeek
- the days of week (or null
to use the day of the
week of the start date)iMonthOfYear
- the month of the year to recur (or 0
to use
the month of the year of the start date)public static TaskRecurrencePattern createYearlyNth(java.util.Date startDate, RecurrenceInstance instance, DaysOfWeek daysOfWeek, int iMonthOfYear, int iOccurrences)
startDate
- the start date of the taskinstance
- the instance of the days of the week that the task recursdaysOfWeek
- the days of week (or null
to use the day of the
week of the start date)iMonthOfYear
- the month of the year to recur (or 0
to use
the month of the year of the start date)iOccurrences
- the number of times the task recurs (greater or equal
to one)public static TaskRecurrencePattern createYearlyNth(java.util.Date startDate, java.util.Date endDate, RecurrenceInstance instance, DaysOfWeek daysOfWeek, int iMonthOfYear)
startDate
- the start date of the taskendDate
- the end date of the task (or null
if the pattern
has no end)instance
- the instance of the days of the week that the task recursdaysOfWeek
- the days of week (or null
to use the day of the
week of the start date)iMonthOfYear
- the month of the year to recur (or 0
to use
the month of the year of the start date)public int getDayOfMonth()
RecurrenceType.MONTHLY
and RecurrenceType.YEARLY
)public DaysOfWeek getDaysOfWeek()
RecurrenceType.WEEKLY
, RecurrenceType.MONTHLY_NTH
and
RecurrenceType.YEARLY_NTH
).public RecurrenceInstance getInstance()
RecurrenceType.MONTHLY_NTH
and RecurrenceType.YEARLY_NTH
).null
if not setpublic int getInterval()
public int getMonthOfYear()
RecurrenceType.YEARLY
and RecurrenceType.YEARLY_NTH
).public boolean hasNoEndDate()
public int getOccurrences()
public int getRegenerate()
public boolean isRegenerating()
public java.util.Date getPatternStartDate()
public java.util.Date getPatternEndDate()
public RecurrenceType getRecurrenceType()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
true
if the two patterns are equal.
|
Compoze Software, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |