public class Recur
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Class and Description |
---|---|
static class |
Recur.Builder
Support for building Recur instances.
|
static class |
Recur.Frequency |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DAILY
Deprecated.
use
Recur.Frequency instead. |
static java.lang.String |
HOURLY
Deprecated.
use
Recur.Frequency instead. |
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
Deprecated.
use
Recur.Frequency instead. |
static java.lang.String |
MONTHLY
Deprecated.
use
Recur.Frequency instead. |
static java.lang.String |
SECONDLY
Deprecated.
use
Recur.Frequency instead. |
static java.lang.String |
WEEKLY
Deprecated.
use
Recur.Frequency instead. |
static java.lang.String |
YEARLY
Deprecated.
use
Recur.Frequency instead. |
Constructor and Description |
---|
Recur(Recur.Frequency frequency,
Date until) |
Recur(Recur.Frequency frequency,
int count) |
Recur(java.lang.String aValue)
Constructs a new instance from the specified string value.
|
Recur(java.lang.String frequency,
Date until)
Deprecated.
|
Recur(java.lang.String frequency,
int count)
Deprecated.
|
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()
Accessor for the configured BYDAY list.
|
java.util.Map<java.lang.String,java.lang.String> |
getExperimentalValues() |
Recur.Frequency |
getFrequency() |
NumberList |
getHourList()
Accessor for the configured BYHOUR list.
|
int |
getInterval() |
NumberList |
getMinuteList()
Accessor for the configured BYMINUTE list.
|
NumberList |
getMonthDayList()
Accessor for the configured BYMONTHDAY list.
|
NumberList |
getMonthList()
Accessor for the configured BYMONTH list.
|
Date |
getNextDate(Date seed,
Date startDate)
Returns the the next date of this recurrence given a seed date
and start date.
|
NumberList |
getSecondList()
Accessor for the configured BYSECOND list.
|
NumberList |
getSetPosList()
Accessor for the configured BYSETPOS list.
|
Date |
getUntil() |
NumberList |
getWeekNoList()
Accessor for the configured BYWEEKNO list.
|
WeekDay.Day |
getWeekStartDay() |
NumberList |
getYearDayList()
Accessor for the configured BYYEARDAY list.
|
void |
setCount(int count)
Deprecated.
will be removed in a future version to support immutable pattern.
|
void |
setFrequency(java.lang.String frequency)
Deprecated.
will be removed in a future version to support immutable pattern.
|
void |
setInterval(int interval)
Deprecated.
will be removed in a future version to support immutable pattern.
|
void |
setUntil(Date until)
Deprecated.
will be removed in a future version to support immutable pattern.
|
void |
setWeekStartDay(WeekDay.Day weekStartDay)
Deprecated.
will be removed in a future version to support immutable pattern.
|
java.lang.String |
toString() |
@Deprecated public static final java.lang.String SECONDLY
Recur.Frequency
instead.@Deprecated public static final java.lang.String MINUTELY
Recur.Frequency
instead.@Deprecated public static final java.lang.String HOURLY
Recur.Frequency
instead.@Deprecated public static final java.lang.String DAILY
Recur.Frequency
instead.@Deprecated public static final java.lang.String WEEKLY
Recur.Frequency
instead.@Deprecated public static final java.lang.String MONTHLY
Recur.Frequency
instead.@Deprecated public static final java.lang.String YEARLY
Recur.Frequency
instead.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(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 valuejava.lang.IllegalArgumentException
- where the recurrence string contains an unrecognised token@Deprecated public Recur(java.lang.String frequency, Date until)
frequency
- a recurrence frequency stringuntil
- maximum recurrence datepublic Recur(Recur.Frequency frequency, Date until)
frequency
- a recurrence frequency stringuntil
- maximum recurrence date@Deprecated public Recur(java.lang.String frequency, int count)
frequency
- a recurrence frequency stringcount
- maximum recurrence countpublic Recur(Recur.Frequency 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 Recur.Frequency getFrequency()
public final int getInterval()
public final Date getUntil()
public final WeekDay.Day getWeekStartDay()
@Deprecated 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 search@Deprecated public final void setCount(int count)
count
- The count to set.@Deprecated public final void setFrequency(java.lang.String frequency)
frequency
- The frequency to set.@Deprecated public final void setInterval(int interval)
interval
- The interval to set.@Deprecated public final void setUntil(Date until)
until
- The until to set.