break;
}
days.addElement(new Integer(occurrence.toInt()));
}
if (appointment.getRecurrence() != null) {
RecurrencePattern recurrence = appointment.getRecurrence();
int type = recurrence.getType();
Day repeatUntil = recurrence.getRepeatUntil();
if (type == RecurrencePattern.REC_DAILY) {
for (int i = 1; i <= 366; i++) {
Day occurrence = startDay.add(i);
if (repeatUntil != null && occurrence.compare(repeatUntil) > 0) {
break;
}
if (!recurrence.isException(occurrence)) {
recurrenceDays.addElement(new Integer(occurrence.toInt()));
days.addElement(new Integer(occurrence.toInt()));
}
}
}
else if (type == RecurrencePattern.REC_WEEKLY) {
for (int i = 1; i <= 105; i++) {
Day occurrence = startDay.add(i*7);
if (repeatUntil != null && occurrence.compare(repeatUntil) > 0) {
break;
}
if (!recurrence.isException(occurrence)) {
recurrenceDays.addElement(new Integer(occurrence.toInt()));
days.addElement(new Integer(occurrence.toInt()));
}
}
}
else if (type == RecurrencePattern.REC_MONTHLY) {
CalendarDate startDate = startDay.getCalendarDate();
for (int i = 1; i <= 24; i++) {
Day occurrence = startDate.addMonths(i);
if (repeatUntil != null && occurrence.compare(repeatUntil) > 0) {
break;
}
if (!recurrence.isException(occurrence)) {
recurrenceDays.addElement(new Integer(occurrence.toInt()));
days.addElement(new Integer(occurrence.toInt()));
}
}
}
else if (type == RecurrencePattern.REC_YEARLY) {
CalendarDate startDate = startDay.getCalendarDate();
for (int i = 1; i <= 5; i++) {
Day occurrence = startDate.addYears(i);
if (repeatUntil != null && occurrence.compare(repeatUntil) > 0) {
break;
}
if (!recurrence.isException(occurrence)) {
recurrenceDays.addElement(new Integer(occurrence.toInt()));
days.addElement(new Integer(occurrence.toInt()));
}
}
}