|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.cc.framework.ui.model.imp.RecurrencePatternImp
Recurrence pattern for appointments
Nested Class Summary | |
protected static class |
RecurrencePatternImp.AbstractRecurrenceIterator
Day iterator |
static class |
RecurrencePatternImp.DailyIterator
Daily iterator |
static class |
RecurrencePatternImp.MonthlyIterator
Monthly iterator |
static class |
RecurrencePatternImp.MonthlyNthIterator
Monthly iterator |
static class |
RecurrencePatternImp.WeeklyIterator
Weekly iterator |
static class |
RecurrencePatternImp.YearlyIterator
Yearly iterator |
static class |
RecurrencePatternImp.YearlyNthIterator
Yearly iterator |
Field Summary | |
private Appointment |
appointment
The appointment this recurrence pattern is attached to |
private int |
dayOfMonth
The Day of the month |
private int |
dayOfWeekMask
Bit mask for a day of the week (use the CalendarHelp.DOWM_xxx constants) Sunday = CalendarHelp.DOWM_SUNDAY Monday = CalendarHelp.DOWM_MONDAY Tuesday = CalendarHelp.DOWM_TUESDAY ... |
protected static java.lang.String |
ERR_ATTR
Exception text |
protected static java.lang.String |
ERR_ATTR_VALUE
Exception text |
protected static java.lang.String |
ERR_ATTR_ZERO
Exception text |
protected static java.lang.String |
ERR_MASK
Exception text |
protected static java.lang.String |
ERR_NOT_IMPLEMENTED
Exception text |
private int |
instance
The Instance property is used when the AppointmentItem is to recur only once during each recurrence unit, such as the second Wednesday of every month or the first Tuesday of every January. |
private int |
interval
The Interval property is used when the AppointmentItem is to recur less often than every recurrence unit, such as once every three days, once every two weeks, or once every six months. |
private int |
monthOfYear
The MonthOfYear property contains the calendar number of the month in which the AppointmentItem is to recur, for example the value 2 to indicate February. |
private int |
occurrences
The Occurrences property is used when the appointment is to recur a specific number of times, such as the next ten Thursdays. |
private java.util.Calendar |
patternEndDate
The PatternEndDate property contains the latest possible date of the last occurrence of the appointment. |
private java.util.Calendar |
patternStartDate
The PatternStartDate property contains the earliest possible date of the first occurrence of the appointment. |
private RecurrenceType |
recurType
Recurrence Type |
Constructor Summary | |
RecurrencePatternImp()
Constructor |
Method Summary | |
protected java.util.Calendar |
calcPatternEndDate()
This method calculates the patterns end date from the pattern start date and the number of occurrences |
static RecurrencePatternImp |
createDailyPattern(int interval,
int dayOfWeekMask)
Constructor for a daily recurrence pattern |
static RecurrencePatternImp |
createMonthlyNthPattern(int interval,
int instance,
int dayOfWeekMask)
Constructor for a monthly (N-th) recurrence pattern |
static RecurrencePatternImp |
createMonthlyPattern(int interval,
int dayOfMonth)
Constructor for a monthly recurrence pattern |
static RecurrencePatternImp |
createWeeklyPattern(int interval,
int dayOfWeekMask)
Constructor for a weekly recurrence pattern |
static RecurrencePatternImp |
createYearlyNthPattern(int instance,
int dayOfWeekMask,
int monthOfYear)
Constructor for a yearly (N-th) recurrence pattern |
static RecurrencePatternImp |
createYearlyPattern(int dayOfMonth,
int monthOfYear)
Constructor for a yearly recurrence pattern |
Appointment |
getAppointment()
|
int |
getDayOfMonth()
The DayOfMonth property contains the calendar date of each month on which the AppointmentItem is to recur, for example the value 1 to indicate the first day of every month. |
int |
getDayOfWeekMask()
The maximum value for the DayOfWeekMask property is 127, which is the logical inclusive OR of all seven days. |
RecurrenceException[] |
getExceptions()
|
int |
getInstance()
The Instance property is used when the AppointmentItem is to recur only once during each recurrence unit, such as the second Wednesday of every month or the first Tuesday of every January. |
int |
getInterval()
The Interval property is used when the AppointmentItem is to recur less often than every recurrence unit, such as once every three days, once every two weeks, or once every six months. |
int |
getMonthOfYear()
The MonthOfYear property contains the calendar number of the month in which the AppointmentItem is to recur, for example the value 2 to indicate February. |
int |
getOccurrences()
The Occurrences property is used when the appointment is to recur a specific number of times, such as the next ten Thursdays. |
java.util.Calendar |
getPatternEndDate()
The PatternEndDate property contains the latest possible date of the last occurrence of the appointment. |
java.util.Calendar |
getPatternStartDate()
The PatternStartDate property contains the earliest possible date of the first occurrence of the appointment. |
RecurrenceType |
getRecurrenceType()
|
boolean |
hasNoEndDate()
The NoEndDate property contains True if the AppointmentItem object is to recur indefinitely and False if the recurrence has a terminal date. |
java.util.Iterator |
iterator()
This method creates an iterator that can be used to iterate the single occurrences of this pattern. |
boolean |
match(java.util.Calendar date)
This method checks if the recurrence pattern matches the given date |
void |
setAppointment(Appointment appointment)
sets the reference to the appointment item |
void |
setPattern(RecurrenceType recurType,
int dayOfMonth,
int dayOfWeekMask,
int instance,
int interval,
int monthOfYear)
Sets the recurrence pattern fields |
RecurrencePatternImp |
setRange(java.util.Calendar patternStartDate)
Sets the patterns range |
RecurrencePatternImp |
setRange(java.util.Calendar patternStartDate,
java.util.Calendar patternEndDate)
Sets the patterns range |
RecurrencePatternImp |
setRange(java.util.Calendar patternStartDate,
int occurrences)
Sets the patterns range |
void |
validate()
This method validates the current recurrence settings. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final java.lang.String ERR_NOT_IMPLEMENTED
protected static final java.lang.String ERR_MASK
protected static final java.lang.String ERR_ATTR
protected static final java.lang.String ERR_ATTR_ZERO
protected static final java.lang.String ERR_ATTR_VALUE
private Appointment appointment
private RecurrenceType recurType
private int dayOfMonth
private int dayOfWeekMask
CalendarHelp
private int instance
private int interval
private int monthOfYear
private int occurrences
private java.util.Calendar patternEndDate
private java.util.Calendar patternStartDate
Constructor Detail |
public RecurrencePatternImp()
Method Detail |
public void setPattern(RecurrenceType recurType, int dayOfMonth, int dayOfWeekMask, int instance, int interval, int monthOfYear)
RecurrencePattern
setPattern
in interface RecurrencePattern
recurType
- Recurrence TypedayOfMonth
- Day of MonthdayOfWeekMask
- Day of Week maskinstance
- instanceinterval
- intervalmonthOfYear
- month of the yearRecurrencePattern.setPattern(com.cc.framework.ui.model.RecurrenceType, int, int, int, int, int)
public void validate()
public static RecurrencePatternImp createDailyPattern(int interval, int dayOfWeekMask)
interval
- Every N daysdayOfWeekMask
- Every Tuesday, Wednesday, and Thursday (use the
CalendarHelp.DOWM_xxxxx constants)
public static RecurrencePatternImp createWeeklyPattern(int interval, int dayOfWeekMask)
interval
- Every N weeksdayOfWeekMask
- Every Tuesday, Wednesday, and Thursday
public static RecurrencePatternImp createMonthlyPattern(int interval, int dayOfMonth)
interval
- Every N monthsdayOfMonth
- The N-th day of the month
public static RecurrencePatternImp createMonthlyNthPattern(int interval, int instance, int dayOfWeekMask)
interval
- Every N monthsinstance
- The N-th TuesdaydayOfWeekMask
- Every Tuesday and Wednesday
public static RecurrencePatternImp createYearlyPattern(int dayOfMonth, int monthOfYear)
dayOfMonth
- The N-th day of the monthmonthOfYear
- February
public static RecurrencePatternImp createYearlyNthPattern(int instance, int dayOfWeekMask, int monthOfYear)
instance
- The N-th TuesdaydayOfWeekMask
- Tuesday, Wednesday, ThursdaymonthOfYear
- February
public int getDayOfMonth()
RecurrencePattern
getDayOfMonth
in interface RecurrencePattern
RecurrencePattern.getDayOfMonth()
public int getDayOfWeekMask()
RecurrencePattern
getDayOfWeekMask
in interface RecurrencePattern
RecurrencePattern.getDayOfWeekMask()
public int getInstance()
RecurrencePattern
getInstance
in interface RecurrencePattern
RecurrencePattern.getInstance()
public int getInterval()
RecurrencePattern
getInterval
in interface RecurrencePattern
RecurrencePattern.getInterval()
public int getMonthOfYear()
RecurrencePattern
getMonthOfYear
in interface RecurrencePattern
RecurrencePattern.getMonthOfYear()
public int getOccurrences()
RecurrencePattern
getOccurrences
in interface RecurrencePattern
RecurrencePattern.getOccurrences()
public Appointment getAppointment()
getAppointment
in interface RecurrencePattern
RecurrencePattern.getAppointment()
public void setAppointment(Appointment appointment)
RecurrencePattern
setAppointment
in interface RecurrencePattern
appointment
- appointment itemRecurrencePattern.setAppointment(com.cc.framework.ui.model.Appointment)
public java.util.Calendar getPatternEndDate()
RecurrencePattern
getPatternEndDate
in interface RecurrencePattern
RecurrencePattern.getPatternEndDate()
public java.util.Calendar getPatternStartDate()
RecurrencePattern
getPatternStartDate
in interface RecurrencePattern
RecurrencePattern.getPatternStartDate()
public RecurrenceType getRecurrenceType()
getRecurrenceType
in interface RecurrencePattern
RecurrencePattern.getRecurrenceType()
public boolean hasNoEndDate()
RecurrencePattern
hasNoEndDate
in interface RecurrencePattern
true
if the AppointmentItem object is to recur
indefinitelyRecurrencePattern.hasNoEndDate()
public RecurrenceException[] getExceptions()
getExceptions
in interface RecurrencePattern
RecurrencePattern.getExceptions()
public RecurrencePatternImp setRange(java.util.Calendar patternStartDate)
patternStartDate
- the start date for this pattern
public RecurrencePatternImp setRange(java.util.Calendar patternStartDate, java.util.Calendar patternEndDate)
patternStartDate
- the start date for this patternpatternEndDate
- the end date for this pattern or null
public RecurrencePatternImp setRange(java.util.Calendar patternStartDate, int occurrences)
patternStartDate
- the start date for this patternoccurrences
- the number of occurrences for this pattern or
null
public boolean match(java.util.Calendar date)
RecurrencePattern
match
in interface RecurrencePattern
date
- The date to check
true
if the pattern matches the DateRecurrencePattern.match(java.util.Calendar)
protected java.util.Calendar calcPatternEndDate()
public java.util.Iterator iterator()
iterator
in interface RecurrencePattern
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |