Top Description Inners Fields Constructors Methods
net.fortuna.ical4j.model

public Class Recur<T extends Temporal>

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
net.fortuna.ical4j.transform.recurrence.*, net.fortuna.ical4j.util.CompatibilityHints, .Configurator, org.slf4j.Logger, .LoggerFactory, java.io.IOException, .Serializable, java.time.DayOfWeek, .Duration, java.time.chrono.Chronology, java.time.temporal.*, java.util.*, java.util.function.Consumer, java.util.stream.Collectors, .Stream, .StreamSupport

$Id$ [18-Apr-2004]
    3.3.10.  Recurrence Rule

   Value Name:  RECUR

   Purpose:  This value type is used to identify properties that contain
      a recurrence rule specification.

   Format Definition:  This value type is defined by the following
      notation:

       recur           = recur-rule-part *( ";" recur-rule-part )
                       ;
                       ; The rule parts are not ordered in any
                       ; particular sequence.
                       ;
                       ; The FREQ rule part is REQUIRED,
                       ; but MUST NOT occur more than once.
                       ;
                       ; The UNTIL or COUNT rule parts are OPTIONAL,
                       ; but they MUST NOT occur in the same 'recur'.
                       ;

                       ; The other rule parts are OPTIONAL,
                       ; but MUST NOT occur more than once.

       recur-rule-part = ( "FREQ" "=" freq )
                       / ( "UNTIL" "=" enddate )
                       / ( "COUNT" "=" 1*DIGIT )
                       / ( "INTERVAL" "=" 1*DIGIT )
                       / ( "BYSECOND" "=" byseclist )
                       / ( "BYMINUTE" "=" byminlist )
                       / ( "BYHOUR" "=" byhrlist )
                       / ( "BYDAY" "=" bywdaylist )
                       / ( "BYMONTHDAY" "=" bymodaylist )
                       / ( "BYYEARDAY" "=" byyrdaylist )
                       / ( "BYWEEKNO" "=" bywknolist )
                       / ( "BYMONTH" "=" bymolist )
                       / ( "BYSETPOS" "=" bysplist )
                       / ( "WKST" "=" weekday )

       freq        = "SECONDLY" / "MINUTELY" / "HOURLY" / "DAILY"
                   / "WEEKLY" / "MONTHLY" / "YEARLY"

       enddate     = date / date-time

       byseclist   = ( seconds *("," seconds) )

       seconds     = 1*2DIGIT       ;0 to 60

       byminlist   = ( minutes *("," minutes) )

       minutes     = 1*2DIGIT       ;0 to 59

       byhrlist    = ( hour *("," hour) )

       hour        = 1*2DIGIT       ;0 to 23

       bywdaylist  = ( weekdaynum *("," weekdaynum) )

       weekdaynum  = [[plus / minus] ordwk] weekday

       plus        = "+"

       minus       = "-"

       ordwk       = 1*2DIGIT       ;1 to 53

       weekday     = "SU" / "MO" / "TU" / "WE" / "TH" / "FR" / "SA"
       ;Corresponding to SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY,
       ;FRIDAY, and SATURDAY days of the week.

       bymodaylist = ( monthdaynum *("," monthdaynum) )

       monthdaynum = [plus / minus] ordmoday

       ordmoday    = 1*2DIGIT       ;1 to 31

       byyrdaylist = ( yeardaynum *("," yeardaynum) )

       yeardaynum  = [plus / minus] ordyrday

       ordyrday    = 1*3DIGIT      ;1 to 366

       bywknolist  = ( weeknum *("," weeknum) )

       weeknum     = [plus / minus] ordwk

       bymolist    = ( monthnum *("," monthnum) )

       monthnum    = 1*2DIGIT       ;1 to 12

       bysplist    = ( setposday *("," setposday) )

       setposday   = yeardaynum
Author
Ben Fortuna
Version
2.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
Recur.Builder<T extends Temporal>

Support for building Recur instances.

private class
public static enum
public static enum

Field Summary

Modifier and TypeField and Description
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private TemporalUnit
private static final Comparator<Temporal>
private static final String
private Integer
public static final String
DAILY

Deprecated use Frequency instead.
Day frequency resolution.
private final List<WeekDay>
private final Map<String, String>
private static final String
private Frequency
private List<Integer>
public static final String
HOURLY

Deprecated use Frequency instead.
Hour frequency resolution.
private static final String
private Integer
public static final 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.

private transient Logger
private static final int
private List<Integer>
public static final String
MINUTELY

Deprecated use Frequency instead.
Minute frequency resolution.
private List<Integer>
private List<Month>
public static final String
MONTHLY

Deprecated use Frequency instead.
Month frequency resolution.
private static final String
private Recur.RScale
private List<Integer>
public static final String
SECONDLY

Deprecated use Frequency instead.
Second frequency resolution.
private static final long
private List<Integer>
private static final String
private Recur.Skip
private static final String
private TemporalAdapter<T>
public static final String
WEEKLY

Deprecated use Frequency instead.
Week frequency resolution.
private List<Integer>
private WeekDay
private static final String
private List<Integer>
public static final String
YEARLY

Deprecated use Frequency instead.
Year frequency resolution.

Constructor Summary

AccessConstructor and Description
private
Recur()

Default constructor.

public
Recur(final String
a string representation of a recurrence.
aValue
)

Constructs a new instance from the specified string value.

public
Recur(final String
a string representation of a recurrence.
aValue
,
boolean
allow unrecognised tokens in the recurrence
experimentalTokensAllowed
)

Constructs a new recurrence from the specified string value.

public
Recur(final String
a recurrence frequency string
frequency
,
final T
maximum recurrence date
until
)
Deprecated

public
Recur(final Frequency frequency)

public
Recur(final Frequency
a recurrence frequency string
frequency
,
final T
maximum recurrence date
until
)

public
Recur(final String
a recurrence frequency string
frequency
,
final int
maximum recurrence count
count
)
Deprecated

public
Recur(final Frequency
a recurrence frequency string
frequency
,
final int
maximum recurrence count
count
)

Method Summary

Modifier and TypeMethod and Description
private Frequency
public boolean
equals(Object
the reference object with which to compare.
o
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

private List<T>

Returns:

a List of Temporal of the same type as the seed date
getCandidates
(final T rootSeed, final T
the seed date
date
)

Returns a list of possible dates generated from the applicable BY* rules, using the specified date as a seed.

public final int

Returns:

Returns the count or -1 if the rule does not have a count.
getCount
()

public final List<T>

Returns:

a list of dates
getDates
(final T
the start of the period
periodStart
,
final T
the end of the period
periodEnd
)

Returns a list of start dates in the specified period represented by this recur.

public final List<T>

Returns:

a list of dates
getDates
(final T
a seed date for generating recurrence instances
seed
,
final Period<? extends Temporal>
the period of returned recurrence dates
period
)

Convenience method for retrieving recurrences in a specified period.

public final List<T>

Returns:

a list of dates represented by this recur instance
getDates
(final T
the start date of this Recurrence's first instance
seed
,
final Temporal
the start of the period
periodStart
,
final Temporal
the end of the period
periodEnd
)

Returns a list of start dates in the specified period represented by this recur.

public final List<T>

Returns:

a list of dates represented by this recur instance
getDates
(final T
the start date of this Recurrence's first instance
seed
,
final Temporal
the start of the period
periodStart
,
final Temporal
the end of the period
periodEnd
,
final int
limits the number of instances returned. Up to one years worth extra may be returned. Less than 0 means no limit
maxCount
)

Returns a list of start dates in the specified period represented by this recur.

public final Stream<T>
getDatesAsStream(final T seed, final Temporal periodStart, final Temporal periodEnd, int maxCount)

public final List<WeekDay>

Returns:

Returns the dayList.
getDayList
()

Accessor for the configured BYDAY list.

public final Map<String, String>

Returns:

Returns the experimentalValues.
getExperimentalValues
()

public final Frequency

Returns:

Returns the frequency.
getFrequency
()

public final List<Integer>

Returns:

Returns the hourList.
getHourList
()

Accessor for the configured BYHOUR list.

public final int

Returns:

Returns the interval or -1 if the rule does not have an interval defined.
getInterval
()

public final List<Integer>

Returns:

Returns the minuteList.
getMinuteList
()

Accessor for the configured BYMINUTE list.

public final List<Integer>

Returns:

Returns the monthDayList.
getMonthDayList
()

Accessor for the configured BYMONTHDAY list.

public final List<Month>

Returns:

Returns the monthList.
getMonthList
()

Accessor for the configured BYMONTH list.

public final T

Returns:

the next date in the recurrence series after startDate
getNextDate
(final T
the start date of this Recurrence's first instance
seed
,
final T
the date to start the search
startDate
)

Returns the next date of this recurrence given a seed date and start date.

public final List<Integer>

Returns:

Returns the secondList.
getSecondList
()

Accessor for the configured BYSECOND list.

public final List<Integer>

Returns:

Returns the setPosList.
getSetPosList
()

Accessor for the configured BYSETPOS list.

public Recur.Skip

Returns:

leap month skip behaviour.
getSkip
()

public final T

Returns:

Returns the until or null if there is none.
getUntil
()

public final List<Integer>

Returns:

Returns the weekNoList.
getWeekNoList
()

Accessor for the configured BYWEEKNO list.

public final WeekDay

Returns:

Returns the weekStartDay or null if there is none.
getWeekStartDay
()

public final List<Integer>

Returns:

Returns the yearDayList.
getYearDayList
()

Accessor for the configured BYYEARDAY list.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

private T
increment(final T
a Temporal value to increment
cal
,
int multiplier)

Increments the specified temporal according to the frequency and interval specified in this recurrence rule.

private String
nextToken(Iterator<String> tokens, String lastToken)

private void
public final void
setCount(final int
The count to set.
count
)
Deprecated will be removed in a future version to support immutable pattern.

public final void
setFrequency(final String
The frequency to set.
frequency
)
Deprecated will be removed in a future version to support immutable pattern.

public final void
setInterval(final int
The interval to set.
interval
)
Deprecated will be removed in a future version to support immutable pattern.

public final void
setUntil(final T
The until to set.
until
)
Deprecated will be removed in a future version to support immutable pattern.

public final void
setWeekStartDay(final WeekDay
The weekStartDay to set.
weekStartDay
)
Deprecated will be removed in a future version to support immutable pattern.

public final String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

private void
private static TemporalUnit
weekBasedYears(DayOfWeek weekStartDay)

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait