public class Recur
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DAILY
Day frequency resolution.
|
static java.lang.String |
HOURLY
Hour frequency resolution.
|
static java.lang.String |
KEY_MAX_INCREMENT_COUNT
When calculating dates matching this recur (
getDates() or getNextDate ),
this property defines the maximum number of attempt to find a matching date by
incrementing the seed. |
static java.lang.String |
MINUTELY
Minute frequency resolution.
|
static java.lang.String |
MONTHLY
Month frequency resolution.
|
static java.lang.String |
SECONDLY
Second frequency resolution.
|
static java.lang.String |
WEEKLY
Week frequency resolution.
|
static java.lang.String |
YEARLY
Year frequency resolution.
|
Constructor and Description |
---|
Recur()
Default constructor.
|
Recur(java.lang.String aValue)
Constructs a new instance from the specified string value.
|
Recur(java.lang.String frequency,
Date until) |
Recur(java.lang.String frequency,
int count) |
Modifier and Type | Method and Description |
---|---|
int |
getCount() |
DateList |
getDates(Date seed,
Date periodStart,
Date periodEnd,
Value value)
Returns a list of start dates in the specified period represented by this recur.
|
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.
|
DateList |
getDates(Date periodStart,
Date periodEnd,
Value value)
Returns a list of start dates in the specified period represented by this recur.
|
DateList |
getDates(Date seed,
Period period,
Value value)
Convenience method for retrieving recurrences in a specified period.
|
WeekDayList |
getDayList() |
java.util.Map<java.lang.String,java.lang.String> |
getExperimentalValues() |
java.lang.String |
getFrequency() |
NumberList |
getHourList() |
int |
getInterval() |
NumberList |
getMinuteList() |
NumberList |
getMonthDayList() |
NumberList |
getMonthList() |
Date |
getNextDate(Date seed,
Date startDate)
Returns the the next date of this recurrence given a seed date
and start date.
|
NumberList |
getSecondList() |
NumberList |
getSetPosList() |
Date |
getUntil() |
NumberList |
getWeekNoList() |
WeekDay.Day |
getWeekStartDay() |
NumberList |
getYearDayList() |
void |
setCount(int count) |
void |
setFrequency(java.lang.String frequency) |
void |
setInterval(int interval) |
void |
setUntil(Date until) |
void |
setWeekStartDay(WeekDay.Day weekStartDay) |
java.lang.String |
toString() |
public static final java.lang.String SECONDLY
public static final java.lang.String MINUTELY
public static final java.lang.String HOURLY
public static final java.lang.String DAILY
public static final java.lang.String WEEKLY
public static final java.lang.String MONTHLY
public static final java.lang.String YEARLY
public static final java.lang.String KEY_MAX_INCREMENT_COUNT
getDates()
or getNextDate
),
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.
public Recur()
public Recur(java.lang.String aValue) throws java.text.ParseException
aValue
- a string representation of a recurrence.java.text.ParseException
- thrown when the specified string contains an invalid representation of an UNTIL date valuepublic Recur(java.lang.String frequency, Date until)
frequency
- a recurrence frequency stringuntil
- maximum recurrence datepublic Recur(java.lang.String frequency, int count)
frequency
- a recurrence frequency stringcount
- maximum recurrence countpublic final WeekDayList getDayList()
public final NumberList getHourList()
public final NumberList getMinuteList()
public final NumberList getMonthDayList()
public final NumberList getMonthList()
public final NumberList getSecondList()
public final NumberList getSetPosList()
public final NumberList getWeekNoList()
public final NumberList getYearDayList()
public final int getCount()
public final java.util.Map<java.lang.String,java.lang.String> getExperimentalValues()
public final java.lang.String getFrequency()
public final int getInterval()
public final Date getUntil()
public final WeekDay.Day getWeekStartDay()
public final void setWeekStartDay(WeekDay.Day weekStartDay)
weekStartDay
- The weekStartDay to set.public final java.lang.String toString()
toString
in class java.lang.Object
public final DateList getDates(Date periodStart, Date periodEnd, Value value)
periodStart
- the start of the periodperiodEnd
- the end of the periodvalue
- the type of dates to generate (i.e. date/date-time)public final DateList getDates(Date seed, Period period, Value value)
seed
- a seed date for generating recurrence instancesperiod
- the period of returned recurrence datesvalue
- type of dates to generatepublic final DateList getDates(Date seed, Date periodStart, Date periodEnd, Value value)
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)public final DateList getDates(Date seed, Date periodStart, Date periodEnd, Value value, int maxCount)
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 limitpublic final Date getNextDate(Date seed, Date startDate)
seed
- the start date of this Recurrence's first instancestartDate
- the date to start the searchpublic final void setCount(int count)
count
- The count to set.public final void setFrequency(java.lang.String frequency)
frequency
- The frequency to set.public final void setInterval(int interval)
interval
- The interval to set.public final void setUntil(Date until)
until
- The until to set.