|
Compoze Software, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.compoze.collab.exchange.RecurrencePattern | +--com.compoze.collab.exchange.AppointmentRecurrencePattern
This class is used to set recurrence patterns on an appoinment.
The following code snippet creates a recurring, daily appointment that has 5 instances and occurs every other day.
Sample code:
Calendar cal = Calendar.getInstance(); // 8:00AM cal.set( 2005, 0, 1, 8, 0, 0 ); Date startTime = cal.getTime(); // 8:45AM cal.add( Calendar.MINUTE, 45 ); Date endTime = cal.getTime(); // create the Java objects to hold the start date // 1/1/2005 cal.set( 2005, 0, 1, 8, 0, 0 ); Date startDate = cal.getTime(); // instead of specify an end date, we can specify the number of // occurrences for this pattern. The pattern will recur 5 times, // or for 5 days. int iOccurrences = 5; // the interval is used to place a space between each instance of the // appointment. Since this is a daily appointment, a value of 2 indicates // that each instance will be two days apart, or 1 day between each int iInterval = 2; AppointmentRecurrencePattern pattern = null; pattern = AppointmentRecurrencePattern.createDaily( startTime, endTime, startDate, iInterval, iOccurrences );The following code snippet creates a recurring, weekly appointment from Tuesday through Thursday each week.
Sample code:
Calendar cal = Calendar.getInstance(); // 8:00AM cal.set( 2005, 0, 1, 8, 0, 0 ); Date startTime = cal.getTime(); // 8:45AM cal.add( Calendar.MINUTE, 45 ); Date endTime = cal.getTime(); // create the Java objects to hold the start date // 1/1/2005 cal.set( 2005, 0, 1, 8, 0, 0 ); Date startDate = cal.getTime(); // 3/1/2005 cal.add( Calendar.MONTH, 2 ); Date endDate = cal.getTime(); // the interval is used to place a space between each instance of the // appointment. Since this is a weekly appointment, a value of 1 indicates // that each instance will be one week apart int iInterval = 1; // this pattern will occur Tuesday through Thursday DaysOfWeek daysOfWeek = new DaysOfWeek(); daysOfWeek.set( DayOfWeekEnum.TUESDAY ); daysOfWeek.set( DayOfWeekEnum.WEDNESDAY ); daysOfWeek.set( DayOfWeekEnum.THURSDAY ); // create a pattern that occurs every week on Tuesday through Thursday // from 8:00AM to 8:45AM, starting on 1/1/05 and ending on // 3/1/05 AppointmentRecurrencePattern pattern = null; pattern = AppointmentRecurrencePattern.createWeekly( startTime, endTime, startDate, endDate, daysOfWeek, iInterval );The following code snippet creates a recurring, monthly appointment.
Sample code:
Calendar cal = Calendar.getInstance(); // 8:00AM cal.set( 2005, 0, 1, 8, 0, 0 ); Date startTime = cal.getTime(); // 8:45AM cal.add( Calendar.MINUTE, 45 ); Date endTime = cal.getTime(); // create the Java objects to hold the start date // 1/1/2005 cal.set( 2005, 0, 1, 8, 0, 0 ); Date startDate = cal.getTime(); // 5/1/2005 cal.add( Calendar.MONTH, 4 ); Date endDate = cal.getTime(); // the interval is used to place a space between each instance of the // appointment. Since this is a monthly appointment, a value of 1 indicates // that each instance will be one month apart int iInterval = 1; // specify the start/end dates and times // 0 for the day of month since we want it to start on the start date // specified AppointmentRecurrencePattern pattern = null; pattern = AppointmentRecurrencePattern.createMonthly( startTime, endTime, startDate, endDate, 0, iInterval );The following code snippet creates a recurring, monthly appointment that occurs on every second Tuesday.
Sample code:
Calendar cal = Calendar.getInstance(); // 8:00AM cal.set( 2005, 0, 1, 8, 0, 0 ); Date startTime = cal.getTime(); // 8:45AM cal.add( Calendar.MINUTE, 45 ); Date endTime = cal.getTime(); // create the Java objects to hold the start date // 1/1/2005 cal.set( 2005, 0, 1, 8, 0, 0 ); Date startDate = cal.getTime(); // 5/1/2005 cal.add( Calendar.MONTH, 4 ); Date endDate = cal.getTime(); // the interval is used to place a space between each instance of the // appointment. Since this is a monthly appointment, a value of 1 indicates // that each instance will be one month apart int iInterval = 1; // this pattern will occur Tuesday DaysOfWeek daysOfWeek = new DaysOfWeek(); daysOfWeek.set( DayOfWeekEnum.TUESDAY ); // occur on the second Tuesday of each month RecurrenceInstance instance = RecurrenceInstanceEnum.SECOND; // create a pattern that occurs every month on the second Tues. // from 8:00AM to 8:45AM, starting on 1/1/05 and ending on // 5/1/05 AppointmentRecurrencePattern pattern = null; pattern = AppointmentRecurrencePattern.createMonthlyNth( startTime, endTime, startDate, endDate, instance, daysOfWeek, iInterval );The following code snippet creates a recurring, yearly appointment that occurs every year on the first of the month of January forever.
Sample code:
Calendar cal = Calendar.getInstance(); // 8:00AM cal.set( 2005, 0, 1, 8, 0, 0 ); Date startTime = cal.getTime(); // 8:45AM cal.add( Calendar.MINUTE, 45 ); Date endTime = cal.getTime(); // create the Java objects to hold the start date // 1/1/2005 cal.set( 2005, 0, 1, 8, 0, 0 ); Date startDate = cal.getTime(); // the interval is used to place a space between each instance of the // appointment. Since this is a yearly appointment, a value of 1 indicates // that each instance will be one year apart int iInterval = 1; // create a pattern that occurs every year from 8:00AM to 8:45AM, // starting on 1/1/05 and never ending // the values of 0 for the day of month and the month of year indicate // that we want to use the day and month of the start date AppointmentRecurrencePattern pattern = null; pattern = AppointmentRecurrencePattern.createYearly( startTime, endTime, startDate, 0, 0 );
Field Summary | |
static AppointmentRecurrencePattern |
NONE
This constant represents no recurrence, and may be passed in to clear the recurrence pattern on an existing appointment. |
Method Summary | |
static AppointmentRecurrencePattern |
createDaily(java.util.Date startTime,
java.util.Date endTime,
java.util.Date startDate,
java.util.Date endDate,
int iInterval)
Creates a daily appointment recurrence pattern with an end date |
static AppointmentRecurrencePattern |
createDaily(java.util.Date startTime,
java.util.Date endTime,
java.util.Date startDate,
int iInterval)
Creates a daily appointment recurrence pattern with no end date. |
static AppointmentRecurrencePattern |
createDaily(java.util.Date startTime,
java.util.Date endTime,
java.util.Date startDate,
int iInterval,
int iOccurrences)
Creates a daily appointment recurrence pattern for a number of occurrences. |
static AppointmentRecurrencePattern |
createMonthly(java.util.Date startTime,
java.util.Date endTime,
java.util.Date startDate,
java.util.Date endDate,
int iDayOfMonth,
int iInterval)
Creates a monthly recurrence pattern with an end date. |
static AppointmentRecurrencePattern |
createMonthly(java.util.Date startTime,
java.util.Date endTime,
java.util.Date startDate,
int iDayOfMonth,
int iInterval)
Creates a monthly appointment recurrence pattern with no end date. |
static AppointmentRecurrencePattern |
createMonthly(java.util.Date startTime,
java.util.Date endTime,
java.util.Date startDate,
int iDayOfMonth,
int iInterval,
int iOccurrences)
Creates a monthly recurrence pattern for a number of occurrences. |
static AppointmentRecurrencePattern |
createMonthlyNth(java.util.Date startTime,
java.util.Date endTime,
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 AppointmentRecurrencePattern |
createMonthlyNth(java.util.Date startTime,
java.util.Date endTime,
java.util.Date startDate,
RecurrenceInstance instance,
DaysOfWeek daysOfWeek,
int iInterval)
Creates a monthly nth recurrence pattern with no end date. |
static AppointmentRecurrencePattern |
createMonthlyNth(java.util.Date startTime,
java.util.Date endTime,
java.util.Date startDate,
RecurrenceInstance instance,
DaysOfWeek daysOfWeek,
int iInterval,
int iOccurrences)
Creates a monthly nth recurrence pattern for occurrences. |
static AppointmentRecurrencePattern |
createWeekly(java.util.Date startTime,
java.util.Date endTime,
java.util.Date startDate,
java.util.Date endDate,
DaysOfWeek daysOfWeek,
int iInterval)
Creates a weekly recurrence pattern with an end date. |
static AppointmentRecurrencePattern |
createWeekly(java.util.Date startTime,
java.util.Date endTime,
java.util.Date startDate,
DaysOfWeek daysOfWeek,
int iInterval)
Creates a weekly recurrence pattern with no end date. |
static AppointmentRecurrencePattern |
createWeekly(java.util.Date startTime,
java.util.Date endTime,
java.util.Date startDate,
DaysOfWeek daysOfWeek,
int iInterval,
int iOccurrences)
Creates a weekly recurrence pattern for a number of occurrences. |
static AppointmentRecurrencePattern |
createYearly(java.util.Date startTime,
java.util.Date endTime,
java.util.Date startDate,
java.util.Date endDate,
int iMonthOfYear,
int iDayOfMonth)
Creates a yearly recurrence pattern with an end date. |
static AppointmentRecurrencePattern |
createYearly(java.util.Date startTime,
java.util.Date endTime,
java.util.Date startDate,
int iMonthOfYear,
int iDayOfMonth)
Creates a yearly recurrence pattern with no end date. |
static AppointmentRecurrencePattern |
createYearly(java.util.Date startTime,
java.util.Date endTime,
java.util.Date startDate,
int iMonthOfYear,
int iDayOfMonth,
int iOccurrences)
Creates a yearly recurrence pattern ending for a number of occurrences. |
static AppointmentRecurrencePattern |
createYearlyNth(java.util.Date startTime,
java.util.Date endTime,
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 AppointmentRecurrencePattern |
createYearlyNth(java.util.Date startTime,
java.util.Date endTime,
java.util.Date startDate,
RecurrenceInstance instance,
DaysOfWeek daysOfWeek,
int iMonthOfYear)
Creates a yearly nth recurrence pattern with no end date. |
static AppointmentRecurrencePattern |
createYearlyNth(java.util.Date startTime,
java.util.Date endTime,
java.util.Date startDate,
RecurrenceInstance instance,
DaysOfWeek daysOfWeek,
int iMonthOfYear,
int iOccurrences)
Creates a yearly nth recurrence pattern with a number of occurrences. |
boolean |
equals(java.lang.Object o)
Compares equality of two patterns. |
java.util.Date |
getEndTime()
Gets the end time of the pattern. |
static AppointmentRecurrencePattern |
getFrom(IExchangeCalendarItem appt)
Gets the recurrence pattern from an appointment. |
java.util.Date |
getStartTime()
Gets the start time of the pattern. |
void |
setTimes(java.util.Date startTime,
java.util.Date endTime)
Sets the start time and end time of a pattern. |
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 |
public static final AppointmentRecurrencePattern NONE
Method Detail |
public static AppointmentRecurrencePattern createDaily(java.util.Date startTime, java.util.Date endTime, java.util.Date startDate, int iInterval)
startTime
- the start time of the pattern (not null
).endTime
- the end time of the pattern (not null
).startDate
- the start date of the pattern (or null
to use startTime
)iInterval
- the number of days between recurrences. The interval
must be greater than 0
.public static AppointmentRecurrencePattern createDaily(java.util.Date startTime, java.util.Date endTime, java.util.Date startDate, java.util.Date endDate, int iInterval)
startTime
- the start time of the pattern (not null
).endTime
- the end time of the pattern (not null
).startDate
- the start date of the pattern (or null
to use startTime
)endDate
- the end date of the pattern or null
to
specify that the pattern has no end.iInterval
- the number of days between recurrences. The interval
must be greater than 0
.public static AppointmentRecurrencePattern createDaily(java.util.Date startTime, java.util.Date endTime, java.util.Date startDate, int iInterval, int iOccurrences)
startTime
- the start time of the pattern (not null
).endTime
- the end time of the pattern (not null
).startDate
- the start date of the pattern (or null
to use startTime
)iInterval
- the number of days between recurrences. The interval
must be greater than 0
.iOccurrences
- the number of times the appointment recurs. The
occurrences must be greater than 0
.public static AppointmentRecurrencePattern createWeekly(java.util.Date startTime, java.util.Date endTime, java.util.Date startDate, DaysOfWeek daysOfWeek, int iInterval)
startTime
- the start time of the pattern (not null
).endTime
- the end time of the pattern (not null
).startDate
- the start date of the pattern (or null
to use startTime
)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. The interval
must be greater than 0
.public static AppointmentRecurrencePattern createWeekly(java.util.Date startTime, java.util.Date endTime, java.util.Date startDate, java.util.Date endDate, DaysOfWeek daysOfWeek, int iInterval)
startTime
- the start time of the pattern (not null
).endTime
- the end time of the pattern (not null
).startDate
- the start date of the pattern (or null
to use startTime
)endDate
- the end date of the patterndaysOfWeek
- 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. The interval
must be greater than 0
.public static AppointmentRecurrencePattern createWeekly(java.util.Date startTime, java.util.Date endTime, java.util.Date startDate, DaysOfWeek daysOfWeek, int iInterval, int iOccurrences)
startTime
- the start time of the pattern (not null
).endTime
- the end time of the pattern (not null
).startDate
- the start date of the pattern (or null
to use startTime
)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. The interval
must be greater than 0
.iOccurrences
- the number of times the pattern recurs. The
occurrences must be greater than 0
.
to one)public static AppointmentRecurrencePattern createMonthly(java.util.Date startTime, java.util.Date endTime, java.util.Date startDate, int iDayOfMonth, int iInterval)
startTime
- the start time of the pattern (not null
).endTime
- the end time of the pattern (not null
).startDate
- the start date of the pattern (or null
to use startTime
)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. The interval
must be greater than 0
.public static AppointmentRecurrencePattern createMonthly(java.util.Date startTime, java.util.Date endTime, java.util.Date startDate, java.util.Date endDate, int iDayOfMonth, int iInterval)
startTime
- the start time of the pattern (not null
).endTime
- the end time of the pattern (not null
).startDate
- the start date of the pattern (or null
to use startTime
)endDate
- the end date of the patterniDayOfMonth
- 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. The interval
must be greater than 0
.public static AppointmentRecurrencePattern createMonthly(java.util.Date startTime, java.util.Date endTime, java.util.Date startDate, int iDayOfMonth, int iInterval, int iOccurrences)
startTime
- the start time of the pattern (not null
).endTime
- the end time of the pattern (not null
).startDate
- the start date of the pattern (or null
to use startTime
)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. The interval
must be greater than 0
.iOccurrences
- the number of times the pattern recurs. The
occurrences must be greater than 0
.public static AppointmentRecurrencePattern createMonthlyNth(java.util.Date startTime, java.util.Date endTime, java.util.Date startDate, RecurrenceInstance instance, DaysOfWeek daysOfWeek, int iInterval)
startTime
- the start time of the pattern (not null
).endTime
- the end time of the pattern (not null
).startDate
- the start date of the pattern (or null
to use startTime
)instance
- the instance of the days of the week that the appointment recursdaysOfWeek
- the days of week (or null
to use the day of the
week of the start date)iInterval
- the number of months between recurrences. The interval
must be greater than 0
.public static AppointmentRecurrencePattern createMonthlyNth(java.util.Date startTime, java.util.Date endTime, java.util.Date startDate, RecurrenceInstance instance, DaysOfWeek daysOfWeek, int iInterval, int iOccurrences)
startTime
- the start time of the pattern (not null
).endTime
- the end time of the pattern (not null
).startDate
- the start date of the pattern (or null
to use startTime
)instance
- the instance of the days of the week that the pattern recursdaysOfWeek
- the days of week (or null
to use the day of the
week of the start date)iInterval
- the number of months between recurrences. The interval
must be greater than 0
.iOccurrences
- the number of times the pattern recurs. The
occurrences must be greater than 0
.public static AppointmentRecurrencePattern createMonthlyNth(java.util.Date startTime, java.util.Date endTime, java.util.Date startDate, java.util.Date endDate, RecurrenceInstance instance, DaysOfWeek daysOfWeek, int iInterval)
startTime
- the start time of the pattern (not null
).endTime
- the end time of the pattern (not null
).startDate
- the start date of the pattern (or null
to use startTime
)endDate
- the end date of the pattern (or null
if
the pattern has no end)instance
- the instance of the days of the week that the pattern recursdaysOfWeek
- the days of week (or null
to use the day of the
week of the start date)iInterval
- the number of months between recurrences. The interval
must be greater than 0
.public static AppointmentRecurrencePattern createYearly(java.util.Date startTime, java.util.Date endTime, java.util.Date startDate, int iMonthOfYear, int iDayOfMonth)
startTime
- the start time of the pattern (not null
).endTime
- the end time of the pattern (not null
).startDate
- the start date of the pattern (or null
to use startTime
)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 AppointmentRecurrencePattern createYearly(java.util.Date startTime, java.util.Date endTime, java.util.Date startDate, java.util.Date endDate, int iMonthOfYear, int iDayOfMonth)
startTime
- the start time of the pattern (not null
).endTime
- the end time of the pattern (not null
).startDate
- the start date of the pattern (or null
to use startTime
)endDate
- the end date of the pattern (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 AppointmentRecurrencePattern createYearly(java.util.Date startTime, java.util.Date endTime, java.util.Date startDate, int iMonthOfYear, int iDayOfMonth, int iOccurrences)
startTime
- the start time of the pattern (not null
).endTime
- the end time of the pattern (not null
).startDate
- the start date of the pattern (or null
to use startTime
)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 pattern recurs. The
occurrences must be greater than 0
.public static AppointmentRecurrencePattern createYearlyNth(java.util.Date startTime, java.util.Date endTime, java.util.Date startDate, RecurrenceInstance instance, DaysOfWeek daysOfWeek, int iMonthOfYear)
startTime
- the start time of the pattern (not null
).endTime
- the end time of the pattern (not null
).startDate
- the start date of the pattern (or null
to use startTime
)instance
- the instance of the days of the week that the pattern 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 AppointmentRecurrencePattern createYearlyNth(java.util.Date startTime, java.util.Date endTime, java.util.Date startDate, RecurrenceInstance instance, DaysOfWeek daysOfWeek, int iMonthOfYear, int iOccurrences)
startTime
- the start time of the pattern (not null
).endTime
- the end time of the pattern (not null
).startDate
- the start date of the pattern (or null
to use startTime
)instance
- the instance of the days of the week that the pattern 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 pattern recurs. The
occurrences must be greater than 0
.public static AppointmentRecurrencePattern createYearlyNth(java.util.Date startTime, java.util.Date endTime, java.util.Date startDate, java.util.Date endDate, RecurrenceInstance instance, DaysOfWeek daysOfWeek, int iMonthOfYear)
startTime
- the start time of the pattern (not null
).endTime
- the end time of the pattern (not null
).startDate
- the start date of the pattern (or null
to use startTime
)endDate
- the end date of the pattern (or null
if the
pattern has no end)instance
- the instance of the days of the week that the pattern 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 java.util.Date getStartTime()
public java.util.Date getEndTime()
public static AppointmentRecurrencePattern getFrom(IExchangeCalendarItem appt) throws CollaborationException
appt
- the appointmentCollaborationException
- if there was an error getting the patternpublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
true
if the two patterns are equal.public java.lang.String toString()
toString
in class java.lang.Object
public void setTimes(java.util.Date startTime, java.util.Date endTime)
startTime
- the time that the pattern starts.endTime
- the time that the pattern ends.
|
Compoze Software, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |