Package net.fortuna.ical4j.model
Class Recur
java.lang.Object
net.fortuna.ical4j.model.Recur
- All Implemented Interfaces:
Serializable
$Id$ [18-Apr-2004]
Defines a recurrence.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classSupport for building Recur instances.static enumstatic enumstatic enum -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDeprecated.static final StringDeprecated.useRecur.Frequencyinstead.static final StringWhen calculating dates matching this recur (getDates()orgetNextDate), this property defines the maximum number of attempt to find a matching date by incrementing the seed.static final StringDeprecated.useRecur.Frequencyinstead.static final StringDeprecated.useRecur.Frequencyinstead.static final StringDeprecated.useRecur.Frequencyinstead.static final StringDeprecated.useRecur.Frequencyinstead.static final StringDeprecated.useRecur.Frequencyinstead. -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new instance from the specified string value.Constructs a new recurrence from the specified string value.Deprecated.Deprecated.Recur(Recur.Frequency frequency, int count) Recur(Recur.Frequency frequency, Date until) -
Method Summary
Modifier and TypeMethodDescriptionbooleanfinal intgetCount()final DateListReturns a list of start dates in the specified period represented by this recur.final DateListReturns a list of start dates in the specified period represented by this recur.final DateListReturns a list of start dates in the specified period represented by this recur.final DateListConvenience method for retrieving recurrences in a specified period.getDatesAsStream(Date seed, Date periodStart, Date periodEnd, Value value, int maxCount) final WeekDayListAccessor for the configured BYDAY list.final Recur.Frequencyfinal NumberListAccessor for the configured BYHOUR list.final intfinal NumberListAccessor for the configured BYMINUTE list.final NumberListAccessor for the configured BYMONTHDAY list.final MonthListAccessor for the configured BYMONTH list.final DategetNextDate(Date seed, Date startDate) Returns the next date of this recurrence given a seed date and start date.final NumberListAccessor for the configured BYSECOND list.final NumberListAccessor for the configured BYSETPOS list.getSkip()final DategetUntil()final NumberListAccessor for the configured BYWEEKNO list.final WeekDay.Dayfinal NumberListAccessor for the configured BYYEARDAY list.inthashCode()final voidsetCount(int count) Deprecated.will be removed in a future version to support immutable pattern.final voidsetFrequency(String frequency) Deprecated.will be removed in a future version to support immutable pattern.final voidsetInterval(int interval) Deprecated.will be removed in a future version to support immutable pattern.final voidDeprecated.will be removed in a future version to support immutable pattern.final voidsetWeekStartDay(WeekDay.Day weekStartDay) Deprecated.will be removed in a future version to support immutable pattern.final StringtoString()
-
Field Details
-
SECONDLY
Deprecated.useRecur.Frequencyinstead.Second frequency resolution.- See Also:
-
MINUTELY
Deprecated.useRecur.Frequencyinstead.Minute frequency resolution.- See Also:
-
HOURLY
Deprecated.useRecur.Frequencyinstead.Hour frequency resolution.- See Also:
-
DAILY
Deprecated.useRecur.Frequencyinstead.Day frequency resolution.- See Also:
-
WEEKLY
Deprecated.useRecur.Frequencyinstead.Week frequency resolution.- See Also:
-
MONTHLY
Deprecated.useRecur.Frequencyinstead.Month frequency resolution.- See Also:
-
YEARLY
Deprecated.useRecur.Frequencyinstead.Year frequency resolution.- See Also:
-
KEY_MAX_INCREMENT_COUNT
When calculating dates matching this recur (getDates()orgetNextDate), this property defines the maximum number of attempt to find a matching date by incrementing the seed.The default value is 1000. A value of -1 corresponds to no maximum.
- See Also:
-
-
Constructor Details
-
Recur
Constructs a new instance from the specified string value.- Parameters:
aValue- a string representation of a recurrence.- Throws:
ParseException- thrown when the specified string contains an invalid representation of an UNTIL date valueIllegalArgumentException- where the recurrence string contains an unrecognised token
-
Recur
Constructs a new recurrence from the specified string value.- Parameters:
aValue- a string representation of a recurrence.experimentalTokensAllowed- allow unrecognised tokens in the recurrence- Throws:
ParseException
-
Recur
Deprecated.- Parameters:
frequency- a recurrence frequency stringuntil- maximum recurrence date
-
Recur
- Parameters:
frequency- a recurrence frequency stringuntil- maximum recurrence date
-
Recur
Deprecated.- Parameters:
frequency- a recurrence frequency stringcount- maximum recurrence count
-
Recur
- Parameters:
frequency- a recurrence frequency stringcount- maximum recurrence count
-
-
Method Details
-
getDayList
Accessor for the configured BYDAY list. NOTE: Any changes to the returned list will have no effect on the recurrence rule processing.- Returns:
- Returns the dayList.
-
getHourList
Accessor for the configured BYHOUR list. NOTE: Any changes to the returned list will have no effect on the recurrence rule processing.- Returns:
- Returns the hourList.
-
getMinuteList
Accessor for the configured BYMINUTE list. NOTE: Any changes to the returned list will have no effect on the recurrence rule processing.- Returns:
- Returns the minuteList.
-
getMonthDayList
Accessor for the configured BYMONTHDAY list. NOTE: Any changes to the returned list will have no effect on the recurrence rule processing.- Returns:
- Returns the monthDayList.
-
getMonthList
Accessor for the configured BYMONTH list. NOTE: Any changes to the returned list will have no effect on the recurrence rule processing.- Returns:
- Returns the monthList.
-
getSecondList
Accessor for the configured BYSECOND list. NOTE: Any changes to the returned list will have no effect on the recurrence rule processing.- Returns:
- Returns the secondList.
-
getSetPosList
Accessor for the configured BYSETPOS list. NOTE: Any changes to the returned list will have no effect on the recurrence rule processing.- Returns:
- Returns the setPosList.
-
getWeekNoList
Accessor for the configured BYWEEKNO list. NOTE: Any changes to the returned list will have no effect on the recurrence rule processing.- Returns:
- Returns the weekNoList.
-
getYearDayList
Accessor for the configured BYYEARDAY list. NOTE: Any changes to the returned list will have no effect on the recurrence rule processing.- Returns:
- Returns the yearDayList.
-
getCount
public final int getCount()- Returns:
- Returns the count or -1 if the rule does not have a count.
-
getExperimentalValues
- Returns:
- Returns the experimentalValues.
-
getFrequency
- Returns:
- Returns the frequency.
-
getSkip
- Returns:
- leap month skip behaviour.
-
getInterval
public final int getInterval()- Returns:
- Returns the interval or -1 if the rule does not have an interval defined.
-
getUntil
- Returns:
- Returns the until or null if there is none.
-
getWeekStartDay
- Returns:
- Returns the weekStartDay or null if there is none.
-
setWeekStartDay
Deprecated.will be removed in a future version to support immutable pattern.- Parameters:
weekStartDay- The weekStartDay to set.
-
toString
-
getDates
Returns a list of start dates in the specified period represented by this recur. Any date fields not specified by this recur are retained from the period start, and as such you should ensure the period start is initialised correctly.- Parameters:
periodStart- the start of the periodperiodEnd- the end of the periodvalue- the type of dates to generate (i.e. date/date-time)- Returns:
- a list of dates
-
getDates
Convenience method for retrieving recurrences in a specified period.- Parameters:
seed- a seed date for generating recurrence instancesperiod- the period of returned recurrence datesvalue- type of dates to generate- Returns:
- a list of dates
-
getDates
Returns a list of start dates in the specified period represented by this recur. This method includes a base date argument, which indicates the start of the fist occurrence of this recurrence. The base date is used to inject default values to return a set of dates in the correct format. For example, if the search start date (start) is Wed, Mar 23, 12:19PM, but the recurrence is Mon - Fri, 9:00AM - 5:00PM, the start dates returned should all be at 9:00AM, and not 12:19PM.- Parameters:
seed- the start date of this Recurrence's first instanceperiodStart- the start of the periodperiodEnd- the end of the periodvalue- the type of dates to generate (i.e. date/date-time)- Returns:
- a list of dates represented by this recur instance
-
getDates
public final DateList getDates(Date seed, Date periodStart, Date periodEnd, Value value, int maxCount) Returns a list of start dates in the specified period represented by this recur. This method includes a base date argument, which indicates the start of the fist occurrence of this recurrence. The base date is used to inject default values to return a set of dates in the correct format. For example, if the search start date (start) is Wed, Mar 23, 12:19PM, but the recurrence is Mon - Fri, 9:00AM - 5:00PM, the start dates returned should all be at 9:00AM, and not 12:19PM.- Parameters:
seed- the start date of this Recurrence's first instanceperiodStart- the start of the periodperiodEnd- the end of the periodvalue- the type of dates to generate (i.e. date/date-time)maxCount- limits the number of instances returned. Up to one years worth extra may be returned. Less than 0 means no limit- Returns:
- a list of dates represented by this recur instance
-
getDatesAsStream
-
getNextDate
Returns the next date of this recurrence given a seed date and start date. The seed date indicates the start of the fist occurrence of this recurrence. The start date is the starting date to search for the next recurrence. Return null if there is no occurrence date after start date.- Parameters:
seed- the start date of this Recurrence's first instancestartDate- the date to start the search- Returns:
- the next date in the recurrence series after startDate
-
setCount
Deprecated.will be removed in a future version to support immutable pattern.- Parameters:
count- The count to set.
-
setFrequency
Deprecated.will be removed in a future version to support immutable pattern.- Parameters:
frequency- The frequency to set.
-
setInterval
Deprecated.will be removed in a future version to support immutable pattern.- Parameters:
interval- The interval to set.
-
setUntil
Deprecated.will be removed in a future version to support immutable pattern.- Parameters:
until- The until to set.
-
equals
-
hashCode
public int hashCode()
-
Recur.Frequencyinstead.