Oracle

com.compoze.collab.exchange
Class TaskRecurrencePattern

java.lang.Object
  extended by com.compoze.collab.exchange.RecurrencePattern
      extended by com.compoze.collab.exchange.TaskRecurrencePattern

public final class TaskRecurrencePattern
extends RecurrencePattern

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.


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 task recurrence pattern with an end date.
static TaskRecurrencePattern createDaily(java.util.Date startDate, int iInterval)
          Creates a daily task recurrence pattern 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 task recurrence pattern 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.
static TaskRecurrencePattern getFrom(IExchangeTask task)
          Gets the pattern of a task.
 int getRegenerate()
          Gets the regeneration interval for the pattern type.
 boolean isRegenerating()
          Returns if this pattern is regenerative.
 void setTo(IExchangeTask task)
          Sets the to a task, but does not update member variables of the task.
 java.lang.String toString()
          Gets the string representation of the pattern.
 
Methods inherited from class com.compoze.collab.exchange.RecurrencePattern
getDayOfMonth, getDaysOfWeek, getEndType, getInstance, getInterval, getMonthOfYear, getOccurrences, getPatternEndDate, getPatternStartDate, getType
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NONE

public static final TaskRecurrencePattern NONE
This constant represents no recurrence, and may be passed in to clear the recurrence pattern on an existing task.

Method Detail

createDaily

public static TaskRecurrencePattern createDaily(java.util.Date startDate,
                                                int iInterval)
Creates a daily task recurrence pattern with no end date.

Parameters:
startDate - the start date of the task (not null)
iInterval - the number of days between recurrences
Returns:
the pattern

createDaily

public static TaskRecurrencePattern createDaily(java.util.Date startDate,
                                                java.util.Date endDate,
                                                int iInterval)
Creates a daily task recurrence pattern with an end date.

Parameters:
startDate - the start date of the task (not null)
endDate - the end date of the task (or null if the pattern has no end)
iInterval - the number of days between recurrences
Returns:
the pattern

createDaily

public static TaskRecurrencePattern createDaily(java.util.Date startDate,
                                                int iInterval,
                                                int iOccurrences)
Creates a daily recurrence pattern for a number of occurrences.

Parameters:
startDate - the start date of the task (not null)
iInterval - the number of days between recurrences
iOccurrences - the number of times the task recurs (greater or equal to one)
Returns:
the pattern

createDailyRegenerate

public static TaskRecurrencePattern createDailyRegenerate(java.util.Date startDate,
                                                          int iRegenerate,
                                                          int iOccurrences)
Creates a regenerating daily recurrence pattern for a number of occurrences.

Parameters:
startDate - the start date of the task (not null)
iRegenerate - the number of days between recurrences
iOccurrences - the number of times the task recurs (greater or equal to one)
Returns:
the pattern

createDailyRegenerate

public static TaskRecurrencePattern createDailyRegenerate(java.util.Date startDate,
                                                          int iRegenerate)
Creates a regenerating daily recurrence pattern with no end date.

Parameters:
startDate - the start date of the task (not null)
iRegenerate - the number of days between recurrences
Returns:
the pattern

createWeekly

public static TaskRecurrencePattern createWeekly(java.util.Date startDate,
                                                 DaysOfWeek daysOfWeek,
                                                 int iInterval)
Creates a weekly recurrence pattern with no end date.

Parameters:
startDate - the start date of the task (not null)
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 recurrences
Returns:
the pattern

createWeekly

public static TaskRecurrencePattern createWeekly(java.util.Date startDate,
                                                 java.util.Date endDate,
                                                 DaysOfWeek daysOfWeek,
                                                 int iInterval)
Creates a weekly recurrence pattern with an end date.

Parameters:
startDate - the start date of the task (not null)
endDate - 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 recurrences
Returns:
the pattern

createWeekly

public static TaskRecurrencePattern createWeekly(java.util.Date startDate,
                                                 DaysOfWeek daysOfWeek,
                                                 int iInterval,
                                                 int iOccurrences)
Creates a weekly recurrence pattern for a number of occurrences.

Parameters:
startDate - the start date of the task (not null)
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 recurrences
iOccurrences - the number of times the task recurs (greater or equal to one)
Returns:
the pattern

createWeeklyRegenerate

public static TaskRecurrencePattern createWeeklyRegenerate(java.util.Date startDate,
                                                           int iRegenerate,
                                                           int iOccurrences)
Creates a regenerative weekly recurrence pattern for a number of occurrences.

Parameters:
startDate - the start date of the task (not null)
iRegenerate - 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)
Returns:
the pattern

createWeeklyRegenerate

public static TaskRecurrencePattern createWeeklyRegenerate(java.util.Date startDate,
                                                           int iRegenerate)
Creates a regenerative weekly recurrence pattern with no end date.

Parameters:
startDate - the start date of the task (not null)
iRegenerate - the interval at which to regenerate the task (must be greater than zero)
Returns:
the pattern

createMonthly

public static TaskRecurrencePattern createMonthly(java.util.Date startDate,
                                                  int iDayOfMonth,
                                                  int iInterval)
Creates a monthly task recurrence pattern with no end date.

Parameters:
startDate - the start date of the task (not null)
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 recurrences
Returns:
the pattern

createMonthly

public static TaskRecurrencePattern createMonthly(java.util.Date startDate,
                                                  java.util.Date endDate,
                                                  int iDayOfMonth,
                                                  int iInterval)
Creates a monthly recurrence pattern with an end date.

Parameters:
startDate - the start date of the task (not null)
endDate - 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 recurrences
Returns:
the pattern

createMonthly

public static TaskRecurrencePattern createMonthly(java.util.Date startDate,
                                                  int iDayOfMonth,
                                                  int iInterval,
                                                  int iOccurrences)
Creates a monthly recurrence pattern for a number of occurrences.

Parameters:
startDate - the start date of the task (not null)
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 recurrences
iOccurrences - the number of times the task recurs (greater or equal to one)
Returns:
the pattern

createMonthlyRegenerate

public static TaskRecurrencePattern createMonthlyRegenerate(java.util.Date startDate,
                                                            int iRegenerate)
Creates a regenerative monthly recurrence pattern with no end date.

Parameters:
startDate - the start date of the task (not null)
iRegenerate - the interval at which to regenerate the task (any number but zero will cancel out any setting for endDate)
Returns:
the pattern

createMonthlyRegenerate

public static TaskRecurrencePattern createMonthlyRegenerate(java.util.Date startDate,
                                                            int iRegenerate,
                                                            int iOccurrences)
Creates a regenerative monthly recurrence pattern with occurrences.

Parameters:
startDate - the start date of the task (not null)
iRegenerate - 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)
Returns:
the pattern

createMonthlyNth

public static TaskRecurrencePattern createMonthlyNth(java.util.Date startDate,
                                                     RecurrenceInstance instance,
                                                     DaysOfWeek daysOfWeek,
                                                     int iInterval)
Creates a monthly nth recurrence pattern with no end date.

Parameters:
startDate - the start date of the task (not null)
instance - the instance of the days of the week that the task recurs
daysOfWeek - the days of week (or null to use the day of the week of the start date)
iInterval - the number of months between recurrences
Returns:
the pattern

createMonthlyNth

public static TaskRecurrencePattern createMonthlyNth(java.util.Date startDate,
                                                     RecurrenceInstance instance,
                                                     DaysOfWeek daysOfWeek,
                                                     int iInterval,
                                                     int iOccurrences)
Creates a monthly nth recurrence pattern for occurrences.

Parameters:
startDate - the start date of the task (not null)
instance - the instance of the days of the week that the task recurs
daysOfWeek - the days of week (or null to use the day of the week of the start date)
iInterval - the number of months between recurrences
iOccurrences - the number of times the task recurs (greater or equal to one)
Returns:
the pattern

createMonthlyNth

public 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.

Parameters:
startDate - the start date of the task (not null)
endDate - 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 recurs
daysOfWeek - the days of week (or null to use the day of the week of the start date)
iInterval - the number of months between recurrences
Returns:
the pattern

createYearly

public static TaskRecurrencePattern createYearly(java.util.Date startDate,
                                                 int iMonthOfYear,
                                                 int iDayOfMonth)
Creates a yearly task recurrence pattern with no end date.

Parameters:
startDate - the start date of the task (not null)
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)
Returns:
the pattern

createYearly

public 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.

Parameters:
startDate - the start date of the task (not null)
endDate - 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)
Returns:
the pattern

createYearly

public 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.

Parameters:
startDate - the start date of the task (not null)
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)
iOccurrences - the number of times the task recurs (greater or equal to one)
Returns:
the pattern

createYearlyRegenerate

public static TaskRecurrencePattern createYearlyRegenerate(java.util.Date startDate,
                                                           int iRegenerate)
Creates a regenerating yearly recurrence pattern with no end date.

Parameters:
startDate - the start date of the task (not null)
iRegenerate - the interval at which to regenerate the task (any number but zero will cancel out any setting for endDate)
Returns:
the pattern

createYearlyRegenerate

public static TaskRecurrencePattern createYearlyRegenerate(java.util.Date startDate,
                                                           int iRegenerate,
                                                           int iOccurrences)
Creates a regenerating yearly recurrence pattern with a number of occurrences.

Parameters:
startDate - the start date of the task (not null)
iRegenerate - 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)
Returns:
the pattern

createYearlyNth

public static TaskRecurrencePattern createYearlyNth(java.util.Date startDate,
                                                    RecurrenceInstance instance,
                                                    DaysOfWeek daysOfWeek,
                                                    int iMonthOfYear)
Creates a yearly nth recurrence pattern with no end date.

Parameters:
startDate - the start date of the task (not null)
instance - the instance of the days of the week that the task recurs
daysOfWeek - 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)
Returns:
the pattern

createYearlyNth

public 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.

Parameters:
startDate - the start date of the task (not null)
instance - the instance of the days of the week that the task recurs
daysOfWeek - 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)
Returns:
the pattern

createYearlyNth

public 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.

Parameters:
startDate - the start date of the task (not null)
endDate - 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 recurs
daysOfWeek - 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)
Returns:
the pattern

getRegenerate

public int getRegenerate()
Gets the regeneration interval for the pattern type.

Returns:
an integer indicating the regeneration period

isRegenerating

public boolean isRegenerating()
Returns if this pattern is regenerative.

Returns:
a boolean indicating if the pattern represents a regenerating pattern

toString

public java.lang.String toString()
Gets the string representation of the pattern.

Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Compares equality of two patterns.

Overrides:
equals in class java.lang.Object
Returns:
true if the two patterns are equal.

setTo

public void setTo(IExchangeTask task)
           throws CollaborationException
Sets the to a task, but does not update member variables of the task. NOTE: this is a not a static method. You must have an instance of TaskRecurrencePattern to call it.

Parameters:
task - the task to set the pattern on
Throws:
CollaborationException

getFrom

public static TaskRecurrencePattern getFrom(IExchangeTask task)
                                     throws CollaborationException
Gets the pattern of a task.

Parameters:
task - the task to retrieve the pattern from.
Returns:
the pattern.
Throws:
CollaborationException

Oracle

Copyright ©1999-2008 Oracle All rights reserved.