|
Compoze Software, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.compoze.ebusiness.DateRecurrence
This class describes the way that an exact instant in time recurs, and provides a method to enumerate the recurring dates. The recurrence rules are based largely on the iCalendar specification (RFC #2445), and in fact all iCalendar recurrence rules may be completely specified with this class. Some additional functionality is present, namely the byYear rule.
Inner Class Summary | |
class |
DateRecurrence.DateIterator
This class is an iterator that returns the dates in a DateRecurrence . |
class |
DateRecurrence.DateRangeIterator
This class is an iterator that returns the dates in a DateRecurrence
as a date range (each date plus a duration). |
Field Summary | |
static int |
ALL_DAYS
The value that represents all days of the week. |
static int |
ALL_MONTHS
The value that represents all months of the year. |
static int |
APRIL
The value that represents the month April. |
static int |
AUGUST
The value that represents the month August. |
static int |
BYDAY_FIFTH
The value that represents the fifth weekday of the month (or'd with SUNDAY-SATURDAY constants for the by day rule) |
static int |
BYDAY_FIFTH_TO_LAST
The value that represents the fifth to the last weekday of the month (or'd with SUNDAY-SATURDAY constants for the by day rule) |
static int |
BYDAY_FIRST
The value that represents the first weekday of the month (or'd with SUNDAY-SATURDAY constants for the by day rule) |
static int |
BYDAY_FOURTH
The value that represents the fourth weekday of the month (or'd with SUNDAY-SATURDAY constants for the by day rule) |
static int |
BYDAY_FOURTH_TO_LAST
The value that represents the fourth to the last weekday of the month (or'd with SUNDAY-SATURDAY constants for the by day rule) |
static int |
BYDAY_LAST
The value that represents the last weekday of the month (or'd with SUNDAY-SATURDAY constants for the by day rule) |
static int |
BYDAY_SECOND
The value that represents the second weekday of the month (or'd with SUNDAY-SATURDAY constants for the by day rule) |
static int |
BYDAY_SECOND_TO_LAST
The value that represents the second to the last weekday of the month (or'd with SUNDAY-SATURDAY constants for the by day rule) |
static int |
BYDAY_THIRD
The value that represents the third weekday of the month (or'd with SUNDAY-SATURDAY constants for the by day rule) |
static int |
BYDAY_THIRD_TO_LAST
The value that represents the third to the last weekday of the month (or'd with SUNDAY-SATURDAY constants for the by day rule) |
static int |
DECEMBER
The value that represents the month December. |
static int |
FEBRUARY
The value that represents the month February. |
static int |
FRIDAY
The value that represents the day Friday. |
static int |
JANUARY
The value that represents the month January. |
static int |
JULY
The value that represents the month July. |
static int |
JUNE
The value that represents the month June. |
static int |
MARCH
The value that represents the month March. |
static int |
MAY
The value that represents the month May. |
static int |
MONDAY
The value that represents the day Monday. |
static int |
NOVEMBER
The value that represents the month November. |
static int |
OCTOBER
The value that represents the month October. |
static int |
RECUR_DAILY
The value that represents a daily recurrence. |
static int |
RECUR_HOURLY
The value that represents an hourly recurrence. |
static int |
RECUR_MINUTELY
The value that represents a minutely recurrence. |
static int |
RECUR_MONTHLY
The value that represents a monthly recurrence. |
static int |
RECUR_SECONDLY
The value that represents a secondly recurrence. |
static int |
RECUR_WEEKLY
The value that represents a weekly recurrence. |
static int |
RECUR_YEARLY
The value that represents a yearly recurrence. |
static int |
RULE_ALL_FUTURE
This value indicates 'this and all future instances' rule. |
static int |
RULE_ALL_INSTANCES
This value indicates 'all instances' rule. |
static int |
RULE_ALL_PREVIOUS
This value indicates 'this and all previous instances' rule. |
static int |
RULE_THIS_INSTANCE
This value indicates 'this instance' rule. |
static int |
SATURDAY
The value that represents the day Saturday. |
static int |
SEPTEMBER
The value that represents the month September. |
static int |
SUNDAY
The value that represents the day Sunday. |
static int |
THURSDAY
The value that represents the day Thursday. |
static int |
TUESDAY
The value that represents the day Tuesday. |
static int |
WEDNESDAY
The value that represents the day Wednesday. |
static int |
WEEKDAYS
The value that represents the weekdays (Monday-Friday). |
static int |
WEEKEND_DAYS
The value that represents the weekend days (Saturday and Sunday). |
Constructor Summary | |
DateRecurrence()
Constructor. |
|
DateRecurrence(java.util.Date startDate,
int iFrequency,
int iInterval,
java.util.BitSet bySecond,
java.util.BitSet byMinute,
int iByHour,
int[] byDay,
java.util.BitSet byMonthDay,
java.util.BitSet byYearDay,
java.util.BitSet byWeekNo,
int iByMonth,
int[] byYear,
java.util.BitSet bySetPos,
int iWeekStart,
int iCount,
java.util.Date untilDate)
Constructor. |
Method Summary | |
java.util.SortedSet |
applyRule(java.util.Calendar calendar,
java.util.Date startDate,
java.util.Date endDate)
Applies the rule by returning the resulting dates within the given date range. |
java.util.SortedSet |
applyRule(java.util.Date startDate,
java.util.Date endDate)
Applies the rule by returning the resulting dates within the given date range using the default calendar. |
java.util.SortedSet |
applyRule(DateRange dateRange)
Applies the rule by returning the resulting dates within the given date range using the default calendar. |
java.util.SortedSet |
applyRule(DateRange dateRange,
long lDuration)
Applies the rule by returning a set of date ranges occurring totally or partially within the given date range window. |
static DateRecurrence |
createAnnual(java.util.Date time,
int iDayOfYear,
java.util.Date endDate)
Creates a date recurrence once per year on a given day of the year. |
static DateRecurrence |
createAnnual(java.util.Date time,
int iDayOfYear,
int iCount)
Creates a date recurrence once per year on a given day of the year. |
static DateRecurrence |
createAnnual(java.util.Date time,
int iMonth,
int iDay,
java.util.Date endDate)
Creates a date recurrence once per year on a given month and day. |
static DateRecurrence |
createAnnual(java.util.Date time,
int iMonth,
int iDay,
java.util.Date endDate,
java.util.Calendar calendar)
Creates a date recurrence once per year on a given month and day. |
static DateRecurrence |
createAnnual(java.util.Date time,
int iMonth,
int iDay,
int iCount)
Creates a date recurrence once per year on a given month and day. |
static DateRecurrence |
createAnnual(java.util.Date time,
int iMonth,
int iDay,
int iCount,
java.util.Calendar calendar)
Creates a date recurrence once per year on a given month and day. |
static DateRecurrence |
createDaily(java.util.Date time,
int iDaysOfWeek,
java.util.Date endDate)
Creates a date recurrence that occurs on the given days of the week. |
static DateRecurrence |
createDaily(java.util.Date time,
int iDaysOfWeek,
int iCount)
Creates a date recurrence that occurs on the given days of the week. |
static DateRecurrence |
createEveryNDays(java.util.Date startDate,
int iNDays,
java.util.Date endDate)
Creates a date recurrence that occurs every n days. |
static DateRecurrence |
createEveryNDays(java.util.Date startDate,
int iNDays,
int iCount)
Creates a date recurrence that occurs every n days. |
static DateRecurrence |
createEveryNMonths(java.util.Date startDate,
int iNMonths,
java.util.Date endDate)
Creates a date recurrence that occurs every n months. |
static DateRecurrence |
createEveryNWeeks(java.util.Calendar cal,
java.util.Date startDate,
int iNWeeks,
java.util.Date endDate)
Creates a date recurrence that occurs every n weeks. |
static DateRecurrence |
createEveryNWeeks(java.util.Date startDate,
int iNWeeks,
java.util.Date endDate)
Creates a date recurrence that occurs every n weeks. |
static DateRecurrence |
createEveryNYears(java.util.Date startDate,
int iNYears,
java.util.Date endDate)
Creates a date recurrence that occurs every n years. |
static DateRecurrence |
createMonthly(java.util.Date time,
int iDayOfMonth,
java.util.Date endDate)
Creates a date recurrence once per month on the nth day of the month. |
static DateRecurrence |
createMonthly(java.util.Date time,
int iDayOfMonth,
java.util.Date endDate,
java.util.Calendar calendar)
Creates a date recurrence once per month on the nth day of the month. |
static DateRecurrence |
createMonthly(java.util.Date time,
int iDayOfMonth,
int iCount)
Creates a date recurrence once per month on the nth day of the month. |
static DateRecurrence |
createMonthly(java.util.Date time,
int iDayOfMonth,
int iCount,
java.util.Calendar calendar)
Creates a date recurrence once per month on the nth day of the month. |
static DateRecurrence |
createMonthlyOnWeekdayOfMonth(java.util.Date time,
int iDaysOfWeekMask,
java.util.Date endDate)
Creates a date recurrence once per month on the nth weekday of every month. |
static DateRecurrence |
createMonthlyOnWeekdayOfMonth(java.util.Date time,
int iDaysOfWeekMask,
int iInterval,
int iCount)
Creates a date recurrence once per month on the nth weekday of every month. |
static DateRecurrence |
createWeekday(java.util.Date startDate,
java.util.Date endDate)
Creates a date recurrence that occurs every weekday (Monday-Friday). |
static DateRecurrence |
createWeekday(java.util.Date startDate,
int iCount)
Creates a date recurrence that occurs every weekday (Monday-Friday). |
static DateRecurrence |
createWeekend(java.util.Date startDate,
java.util.Date endDate)
Creates a date recurrence that occurs every weekend day (Saturday and Sunday). |
static DateRecurrence |
createWeekend(java.util.Date startDate,
int iCount)
Creates a date recurrence that occurs every weekend day (Saturday and Sunday). |
static DateRecurrence |
createWeekly(java.util.Calendar cal,
java.util.Date startDate,
java.util.Date endDate)
Creates a date recurrence that occurs weekly. |
static DateRecurrence |
createWeekly(java.util.Calendar cal,
java.util.Date startDate,
int iCount)
Creates a date recurrence that occurs weekly. |
static DateRecurrence |
createWeekly(java.util.Date startDate,
java.util.Date endDate)
Creates a date recurrence that occurs weekly. |
static DateRecurrence |
createWeekly(java.util.Date startDate,
int iCount)
Creates a date recurrence that occurs weekly. |
boolean |
filterByRules(java.util.Calendar calendar)
Applies the by rules on the given calendar to determine if it should be accepted in the recurrence set. |
static int |
getBitSetIndexMonthDay(int iBitSetIndex)
Gets the day of the month that corresponds to the given bit set index in a by month day rule. |
static int |
getBitSetIndexYearDay(int iBitSetIndex)
Gets the day of the year that corresponds to the given bit set index in a by year rule. |
int[] |
getByDay()
Gets the by day rule. |
int |
getByHour()
Gets the by hour rule. |
java.util.BitSet |
getByMinute()
Gets the by minute rule. |
int |
getByMonth()
Gets the by month rule. |
java.util.BitSet |
getByMonthDay()
Gets the by month day rule. |
java.util.BitSet |
getBySecond()
Gets the interval. |
java.util.BitSet |
getBySetPos()
Gets the by setpos rule. |
java.util.BitSet |
getByWeekNumber()
Gets the by week number rule. |
int[] |
getByYear()
Gets the by year rule. |
java.util.BitSet |
getByYearDay()
Gets the by year day rule. |
int |
getCount()
Gets the event count. |
static int |
getDayOfWeekInMonthFromMask(int iDayOfWeekInMonthMask)
Gets the Calendar version of the day of week in month from the day of week in month mask. |
static int |
getDaysFromEndOfMonth(java.util.Calendar calendar,
int iDayOfMonth)
Gets the number of days from the end of the month of the given day for the given calendar. |
static int |
getDaysFromEndOfYear(java.util.Calendar calendar,
int iDayOfYear)
Gets the number of days from the end of the year of the given day for the given calendar. |
java.util.List |
getDeleteDates()
Gets the delete dates. |
java.util.Date |
getEffectiveUntilDate()
Gets the effective until date. |
int |
getFrequency()
Gets the frequency. |
int |
getInterval()
Gets the interval. |
java.util.Iterator |
getIterator()
Gets an iterator that iterates over all of the recurring dates using the default calendar. |
java.util.Iterator |
getIterator(java.util.Calendar cal)
Gets an iterator that iterates over all of the recurring dates using the specified calendar. |
java.util.Iterator |
getIterator(java.util.Calendar calendar,
java.util.Date startDate,
java.util.Date endDate)
Gets an iterator that iterates over the recurring dates. |
java.util.Iterator |
getIterator(java.util.Date startDate,
java.util.Date endDate)
Gets an iterator that iterates over the recurring dates using the default calendar. |
java.util.Iterator |
getIterator(DateRange dateRange)
Gets an iterator that iterates over the recurring dates using the default calendar. |
java.util.Iterator |
getIterator(DateRange dateRange,
long lDuration)
Gets an iterator that iterates over the recurring dates using the default calendar. |
static int |
getMaskFromDayOfWeek(int iDayOfWeek)
Gets the day of week mask suitable for the by day rule from the Calendar version of the day of week. |
static int |
getMaskFromDayOfWeekInMonth(int iDayOfWeekInMonth)
Gets the day of week mask suitable for the by day rule from the Calendar version of the day of week in month. |
static int |
getMonthDayBitSetIndex(int iDayOfMonth)
Gets the bit that should be set in a bit set to represent the specified day of the month. |
java.util.Date |
getStartDate()
Gets the start date. |
java.util.Date |
getUntilDate()
Gets the until date. |
int |
getWeekStart()
Gets the week start. |
static int |
getYearDayBitSetIndex(int iDayOfYear)
Gets the bit that should be set in a bit set to represent the specified day of the year. |
boolean |
isDeleteDate(java.util.Date givenDate)
Checks if the specified date is a delete date. |
static void |
main(java.lang.String[] args)
Exerciser. |
void |
setByDay(int[] byDay)
Sets the by day rule. |
void |
setByHour(int iByHour)
Sets the by hour rule. |
void |
setByMinute(java.util.BitSet byMinute)
Sets the by minute rule. |
void |
setByMonth(int iByMonth)
Sets the by month rule. |
void |
setByMonthDay(java.util.BitSet byMonthDay)
Sets the by month day rule. |
void |
setBySecond(java.util.BitSet bySecond)
Sets the by second rule. |
void |
setBySetPos(java.util.BitSet bySetPos)
Sets the by setpos rule. |
void |
setByWeekNumber(java.util.BitSet byWeekNo)
Sets the by week number rule. |
void |
setByYear(int[] byYear)
Sets the by year rule. |
void |
setByYearDay(java.util.BitSet byYearDay)
Sets the by year day rule. |
void |
setCount(int iCount)
Sets the event count. |
void |
setFrequency(int iFrequency)
Sets the frequency. |
void |
setInterval(int iInterval)
Sets the interval. |
void |
setStartDate(java.util.Date startDate)
Sets the start date. |
void |
setUntilDate(java.util.Date untilDate)
Sets the until date. |
void |
setWeekStart(int iWeekStart)
Sets the week start. |
java.lang.String |
toRecurrenceString()
Creates a string representation of the date recurrence. |
java.lang.String |
toVcalendarString()
Creates a string that contains the vCalendar 2.0 compliant recurrence rule, for example |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int RULE_THIS_INSTANCE
public static final int RULE_ALL_INSTANCES
public static final int RULE_ALL_PREVIOUS
public static final int RULE_ALL_FUTURE
public static final int SUNDAY
public static final int MONDAY
public static final int TUESDAY
public static final int WEDNESDAY
public static final int THURSDAY
public static final int FRIDAY
public static final int SATURDAY
public static final int BYDAY_FIRST
public static final int BYDAY_SECOND
public static final int BYDAY_THIRD
public static final int BYDAY_FOURTH
public static final int BYDAY_FIFTH
public static final int BYDAY_LAST
public static final int BYDAY_SECOND_TO_LAST
public static final int BYDAY_THIRD_TO_LAST
public static final int BYDAY_FOURTH_TO_LAST
public static final int BYDAY_FIFTH_TO_LAST
public static final int ALL_DAYS
public static final int WEEKDAYS
public static final int WEEKEND_DAYS
public static final int JANUARY
public static final int FEBRUARY
public static final int MARCH
public static final int APRIL
public static final int MAY
public static final int JUNE
public static final int JULY
public static final int AUGUST
public static final int SEPTEMBER
public static final int OCTOBER
public static final int NOVEMBER
public static final int DECEMBER
public static final int ALL_MONTHS
public static final int RECUR_YEARLY
public static final int RECUR_MONTHLY
public static final int RECUR_WEEKLY
public static final int RECUR_DAILY
public static final int RECUR_HOURLY
public static final int RECUR_MINUTELY
public static final int RECUR_SECONDLY
Constructor Detail |
public DateRecurrence()
public DateRecurrence(java.util.Date startDate, int iFrequency, int iInterval, java.util.BitSet bySecond, java.util.BitSet byMinute, int iByHour, int[] byDay, java.util.BitSet byMonthDay, java.util.BitSet byYearDay, java.util.BitSet byWeekNo, int iByMonth, int[] byYear, java.util.BitSet bySetPos, int iWeekStart, int iCount, java.util.Date untilDate) throws InvalidRuleException
startDate
- start date (must not be null)iFrequency
- frequency of recurrence (see RECUR_ constants, no dates are
considered below this frequency)iInterval
- the recurrence interval (<=0 will default to 1)bySecond
- bysecond rule, match these seconds (set bits 0-59, null to skip)byMinute
- byminute rule, match these minutes (set bits 0-59, null to skip)iByHour
- byhour rule, match these hours (set bits 0-23 in int, 0 to skip)byDay
- byday rule, match these days (array of int masks of SUNDAY-SATURDAY
constants possibly or'd with one of the BYDAY_ constants, 0 to skip)byMonthDay
- bymonthday rule, match these days of the month (-1 to -31 or 1 to 31, null to skip,
31 is subtracted from bit index to obtain day of month)byYearDay
- byyearday rule, match these days of the year (-1 to -366 or 1 to 366, null to skip,
366 is subtracted from bit index to obtain day of year)byWeekNo
- byweekno rule, match this week number (null to skip, bit 1 is first week of year)iByMonth
- bymonth rule, match these months (0 to skip, see JANUARY-DECEMBER constants)byYear
- byyear rule, match these years (array of ints, null to skip)bySetPos
- bysetpos rule, select returned positions within result (-366 to -1, 1 to 366,
366 is subtracted from bit index to obtain set position,
requires another by rule, null to skip)iWeekStart
- set the start day of the week (see SUNDAY-SATURDAY constants, 0 defaults to Sunday)iCount
- the number of recurrences to match (0 for all)untilDate
- the date to recur until (null for indefinite)InvalidRuleException
- if the specified rule is invalidgetYearDayBitSetIndex(int)
,
getMonthDayBitSetIndex(int)
Method Detail |
public void setStartDate(java.util.Date startDate)
startDate
- the start datepublic java.util.Date getStartDate()
public java.util.List getDeleteDates()
public boolean isDeleteDate(java.util.Date givenDate)
givenDate
- the date to checktrue
if the date is deleted; false
otherwisepublic void setFrequency(int iFrequency)
iFrequency
- the frequencypublic int getFrequency()
public void setInterval(int iInterval)
iInterval
- the intervalpublic int getInterval()
public java.util.Date getEffectiveUntilDate()
public void setBySecond(java.util.BitSet bySecond)
bySecond
- the by second rulepublic java.util.BitSet getBySecond()
public void setByMinute(java.util.BitSet byMinute)
byMinute
- the by minute rulepublic java.util.BitSet getByMinute()
public void setByHour(int iByHour)
iByHour
- the by hour rulepublic int getByHour()
public void setByDay(int[] byDay)
byDay
- the by day rulepublic int[] getByDay()
public void setByMonthDay(java.util.BitSet byMonthDay)
byMonthDay
- the by month day rulepublic java.util.BitSet getByMonthDay()
public void setByYearDay(java.util.BitSet byYearDay)
byYearDay
- the by year day rulepublic java.util.BitSet getByYearDay()
public void setByWeekNumber(java.util.BitSet byWeekNo)
byWeekNo
- the by week number rulepublic java.util.BitSet getByWeekNumber()
public void setByMonth(int iByMonth)
byMonth
- the by month rulepublic int getByMonth()
public void setByYear(int[] byYear)
byYear
- the by year rulepublic int[] getByYear()
public void setBySetPos(java.util.BitSet bySetPos)
bySetPos
- the by setpos rulepublic java.util.BitSet getBySetPos()
public void setWeekStart(int iWeekStart)
iWeekStart
- the week startpublic int getWeekStart()
public void setCount(int iCount)
iCount
- the event countpublic int getCount()
public void setUntilDate(java.util.Date untilDate)
untilDate
- the until datepublic java.util.Date getUntilDate()
public java.util.SortedSet applyRule(java.util.Date startDate, java.util.Date endDate) throws java.lang.ArithmeticException
startDate
- start date, or null for start date of ruleendDate
- end date, or null to use until date of rulejava.lang.ArithmeticException
- if the resulting enumeration would be
of infinite lengthCalendar.getInstance()
,
applyRule(Calendar,Date,Date)
public java.util.SortedSet applyRule(DateRange dateRange)
dateRange
- the date rangejava.lang.ArithmeticException
- if the resulting enumeration would be
of infinite lengthCalendar.getInstance()
,
applyRule(Date,Date)
public java.util.SortedSet applyRule(DateRange dateRange, long lDuration)
dateRange
- the date range window (neither start or end may be null)lDuration
- the duration of each date rangeDateRange
objectspublic java.util.SortedSet applyRule(java.util.Calendar calendar, java.util.Date startDate, java.util.Date endDate) throws java.lang.ArithmeticException
calendar
- the calendar to use to apply the rules (should be
constructed with appropriate time zone and locale)startDate
- start date, or null for start date of ruleendDate
- end date, or null to use until date of rule, which if it
is null, yields the possibility that this method will
loop indefinitelyjava.lang.ArithmeticException
- if it can be determined that the resulting
enumeration would be of infinite length (if the set is of
infinite length an iterator should be used)getIterator(Calendar,Date,Date)
public java.util.Iterator getIterator() throws java.lang.ArithmeticException
Calendar.getInstance()
,
getIterator(Calendar,Date,Date)
public java.util.Iterator getIterator(java.util.Calendar cal) throws java.lang.ArithmeticException
cal
- the calendarCalendar.getInstance()
,
getIterator(Calendar,Date,Date)
public java.util.Iterator getIterator(DateRange dateRange) throws java.lang.ArithmeticException
dateRange
- the date rangeCalendar.getInstance()
,
getIterator(Date,Date)
public java.util.Iterator getIterator(java.util.Date startDate, java.util.Date endDate) throws java.lang.ArithmeticException
startDate
- start date, or null for start date of ruleendDate
- end date, or null to use until date of ruleCalendar.getInstance()
,
getIterator(Calendar,Date,Date)
public java.util.Iterator getIterator(DateRange dateRange, long lDuration) throws java.lang.ArithmeticException
dateRange
- the date rangelDuration
- the duration of each date rangeCalendar.getInstance()
,
getIterator(Calendar,Date,Date)
public java.util.Iterator getIterator(java.util.Calendar calendar, java.util.Date startDate, java.util.Date endDate)
calendar
- the calendar to use to apply the rules (should be
constructed with appropriate time zone and locale)startDate
- start date, or null for start date of ruleendDate
- end date, or null to use until date of rule, which if it
is null, yields the possibility that this method will
loop indefinitelypublic static int getMonthDayBitSetIndex(int iDayOfMonth)
iDayOfMonth
- the day of the monthpublic static int getBitSetIndexMonthDay(int iBitSetIndex)
iBitSetIndex
- the bit set indexpublic static int getYearDayBitSetIndex(int iDayOfYear)
iDayOfYear
- the day of the yearpublic static int getBitSetIndexYearDay(int iBitSetIndex)
iBitSetIndex
- the bit set indexpublic static int getDaysFromEndOfYear(java.util.Calendar calendar, int iDayOfYear)
calendar
- the calendariDayOfYear
- the day of the yearpublic static int getDaysFromEndOfMonth(java.util.Calendar calendar, int iDayOfMonth)
calendar
- the calendariDayOfMonth
- the day of the monthpublic boolean filterByRules(java.util.Calendar calendar)
calendar
- the calendar to testpublic static int getMaskFromDayOfWeek(int iDayOfWeek)
iDayOfWeek
- calendar day of weekpublic static int getMaskFromDayOfWeekInMonth(int iDayOfWeekInMonth)
iDayOfWeekInMonth
- the calendar day of week in monthpublic static int getDayOfWeekInMonthFromMask(int iDayOfWeekInMonthMask)
iDayOfWeekInMonthMask
- the day of week in month maskpublic static DateRecurrence createAnnual(java.util.Date time, int iDayOfYear, int iCount) throws InvalidRuleException
time
- the time of day (date parameters ignored)iDayOfYear
- the day of the year to occur (1-366, negative
to count from the end of the year)iCount
- number of times to occurInvalidRuleException
- if the specified rule is invalidpublic static DateRecurrence createAnnual(java.util.Date time, int iDayOfYear, java.util.Date endDate) throws InvalidRuleException
time
- the time of day (date parameters ignored)iDayOfYear
- the day of the year to occur (1-366, negative
to count from the end of the year)endDate
- end by this dateInvalidRuleException
- if the specified rule is invalidpublic static DateRecurrence createAnnual(java.util.Date time, int iMonth, int iDay, int iCount) throws InvalidRuleException
time
- the time of day (date parameters ignored)iMonth
- the month of the year to occur (see month constants
in java.util.Calendar)iDay
- the day of the month to occur (1-31)iCount
- number of times to occurInvalidRuleException
- if the specified rule is invalidCalendar
public static DateRecurrence createAnnual(java.util.Date time, int iMonth, int iDay, int iCount, java.util.Calendar calendar) throws InvalidRuleException
time
- the time of day (date parameters ignored)iMonth
- the month of the year to occur (see month constants
in java.util.Calendar)iDay
- the day of the month to occur (1-31)iCount
- number of times to occurcalendar
- the calendarInvalidRuleException
- if the specified rule is invalidCalendar
public static DateRecurrence createEveryNYears(java.util.Date startDate, int iNYears, java.util.Date endDate) throws InvalidRuleException
startDate
- the starting date and timeiNYears
- number of years between occurrences of eventendDate
- end by this dateInvalidRuleException
- if the specified rule is invalidpublic static DateRecurrence createAnnual(java.util.Date time, int iMonth, int iDay, java.util.Date endDate) throws InvalidRuleException
time
- the time of day (date parameters ignored)iMonth
- the month of the year to occur (see month constants
in java.util.Calendar)iDay
- the day of the month to occur (1-31)endDate
- end by this dateInvalidRuleException
- if the specified rule is invalidCalendar
public static DateRecurrence createAnnual(java.util.Date time, int iMonth, int iDay, java.util.Date endDate, java.util.Calendar calendar) throws InvalidRuleException
time
- the time of day (date parameters ignored)iMonth
- the month of the year to occur (see month constants
in java.util.Calendar)iDay
- the day of the month to occur (1-31)endDate
- end by this datecalendar
- the calendarInvalidRuleException
- if the specified rule is invalidCalendar
public static DateRecurrence createMonthly(java.util.Date time, int iDayOfMonth, int iCount) throws InvalidRuleException
time
- the time of day (date parameters ignored)iDayOfMonth
- the day of the month that the event occursiCount
- number of times to occurInvalidRuleException
- if the specified rule is invalidpublic static DateRecurrence createMonthly(java.util.Date time, int iDayOfMonth, int iCount, java.util.Calendar calendar) throws InvalidRuleException
time
- the time of day (date parameters ignored)iDayOfMonth
- the day of the month that the event occursiCount
- number of times to occurcalendar
- the calendarInvalidRuleException
- if the specified rule is invalidpublic static DateRecurrence createMonthly(java.util.Date time, int iDayOfMonth, java.util.Date endDate) throws InvalidRuleException
time
- the time of day (date parameters ignored)iDayOfMonth
- the day of the month that the event occursendDate
- end by this dateInvalidRuleException
- if the specified rule is invalidpublic static DateRecurrence createMonthly(java.util.Date time, int iDayOfMonth, java.util.Date endDate, java.util.Calendar calendar) throws InvalidRuleException
time
- the time of day (date parameters ignored)iDayOfMonth
- the day of the month that the event occursendDate
- end by this datecalendar
- the calendarInvalidRuleException
- if the specified rule is invalidpublic static DateRecurrence createEveryNMonths(java.util.Date startDate, int iNMonths, java.util.Date endDate) throws InvalidRuleException
startDate
- the starting date and timeiNMonths
- number of months between occurrences of eventendDate
- end by this dateInvalidRuleException
- if the specified rule is invalidpublic static DateRecurrence createMonthlyOnWeekdayOfMonth(java.util.Date time, int iDaysOfWeekMask, int iInterval, int iCount) throws InvalidRuleException
time
- the time of day (date parameters ignored)iDaysOfWeekMask
- the day of the week mask (see day of week constants
and BYDAY_ constants in this class)iInterval
- recur every this number of monthsiCount
- number of times to occurInvalidRuleException
- if the specified rule is invalidpublic static DateRecurrence createMonthlyOnWeekdayOfMonth(java.util.Date time, int iDaysOfWeekMask, java.util.Date endDate) throws InvalidRuleException
time
- the time of day (date parameters ignored)iDaysOfWeekMask
- the day of the week mask (see day of week constants
and BYDAY_ constants in this class)endDate
- end by this dateInvalidRuleException
- if the specified rule is invalidpublic static DateRecurrence createDaily(java.util.Date time, int iDaysOfWeek, int iCount) throws InvalidRuleException
time
- the time of day (date parameters ignored)iDaysOfWeek
- the days of the week that the event occurs (see
day of week constants in this class)iCount
- number of times to occurInvalidRuleException
- if the specified rule is invalidpublic static DateRecurrence createDaily(java.util.Date time, int iDaysOfWeek, java.util.Date endDate) throws InvalidRuleException
time
- the time of day (date parameters ignored)iDaysOfWeek
- the days of the week that the event occurs (see
day of week constants in this class)endDate
- end by this dateInvalidRuleException
- if the specified rule is invalidpublic static DateRecurrence createEveryNDays(java.util.Date startDate, int iNDays, int iCount) throws InvalidRuleException
startDate
- the starting date and timeiNDays
- number of days between occurrences of eventiCount
- the number of occurrencesInvalidRuleException
- if the specified rule is invalidpublic static DateRecurrence createEveryNDays(java.util.Date startDate, int iNDays, java.util.Date endDate) throws InvalidRuleException
startDate
- the starting date and timeiNDays
- number of days between occurrences of eventendDate
- end by this dateInvalidRuleException
- if the specified rule is invalidpublic static DateRecurrence createWeekly(java.util.Date startDate, int iCount) throws InvalidRuleException
startDate
- the starting date and timeiCount
- the number of occurrencesInvalidRuleException
- if the specified rule is invalidpublic static DateRecurrence createWeekly(java.util.Calendar cal, java.util.Date startDate, int iCount) throws InvalidRuleException
cal
- the calendar to usestartDate
- the starting date and timeiCount
- the number of occurrencesInvalidRuleException
- if the specified rule is invalidpublic static DateRecurrence createWeekly(java.util.Date startDate, java.util.Date endDate) throws InvalidRuleException
startDate
- the starting date and timeiCount
- the number of occurrencesInvalidRuleException
- if the specified rule is invalidpublic static DateRecurrence createWeekly(java.util.Calendar cal, java.util.Date startDate, java.util.Date endDate) throws InvalidRuleException
cal
- the calendar to usestartDate
- the starting date and timeiCount
- the number of occurrencesInvalidRuleException
- if the specified rule is invalidpublic static DateRecurrence createEveryNWeeks(java.util.Date startDate, int iNWeeks, java.util.Date endDate) throws InvalidRuleException
startDate
- the starting date and timeiNWeeks
- number of weeks between occurrences of eventendDate
- end by this dateInvalidRuleException
- if the specified rule is invalidpublic static DateRecurrence createEveryNWeeks(java.util.Calendar cal, java.util.Date startDate, int iNWeeks, java.util.Date endDate) throws InvalidRuleException
cal
- the calendar to usestartDate
- the starting date and timeiNWeeks
- number of weeks between occurrences of eventendDate
- end by this dateInvalidRuleException
- if the specified rule is invalidpublic static DateRecurrence createWeekday(java.util.Date startDate, int iCount) throws InvalidRuleException
startDate
- the starting date and timeiCount
- the number of occurrencesInvalidRuleException
- if the specified rule is invalidpublic static DateRecurrence createWeekday(java.util.Date startDate, java.util.Date endDate) throws InvalidRuleException
startDate
- the starting date and timeendDate
- end by this dateInvalidRuleException
- if the specified rule is invalidpublic static DateRecurrence createWeekend(java.util.Date startDate, int iCount) throws InvalidRuleException
startDate
- the starting date and timeiCount
- the number of occurrencesInvalidRuleException
- if the specified rule is invalidpublic static DateRecurrence createWeekend(java.util.Date startDate, java.util.Date endDate) throws InvalidRuleException
startDate
- the starting date and timeendDate
- end by this dateInvalidRuleException
- if the specified rule is invalidpublic java.lang.String toRecurrenceString()
public java.lang.String toVcalendarString()
RRULE:FREQ=WEEKLY.
public static void main(java.lang.String[] args)
args
-
|
Compoze Software, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |