net.fortuna.ical4j.model
Class Recur

java.lang.Object
  extended by net.fortuna.ical4j.model.Recur
All Implemented Interfaces:
java.io.Serializable

public class Recur
extends java.lang.Object
implements java.io.Serializable

Defines a recurrence.

Version:
2.0
Author:
Ben Fortuna
See Also:
Serialized Form

Field Summary
static java.lang.String DAILY
           
static java.lang.String HOURLY
           
static java.lang.String MINUTELY
           
static java.lang.String MONTHLY
           
static java.lang.String SECONDLY
           
static java.lang.String WEEKLY
           
static java.lang.String YEARLY
           
 
Constructor Summary
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)
           
 
Method Summary
 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 getExperimentalValues()
           
 java.lang.String getFrequency()
           
 NumberList getHourList()
           
 int getInterval()
           
 NumberList getMinuteList()
           
 NumberList getMonthDayList()
           
 NumberList getMonthList()
           
 NumberList getSecondList()
           
 NumberList getSetPosList()
           
 Date getUntil()
           
 NumberList getWeekNoList()
           
 java.lang.String getWeekStartDay()
           
 NumberList getYearDayList()
           
 void setCount(int count)
           
 void setFrequency(java.lang.String frequency)
           
 void setInterval(int interval)
           
 void setUntil(Date until)
           
 void setWeekStartDay(java.lang.String weekStartDay)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SECONDLY

public static final java.lang.String SECONDLY
See Also:
Constant Field Values

MINUTELY

public static final java.lang.String MINUTELY
See Also:
Constant Field Values

HOURLY

public static final java.lang.String HOURLY
See Also:
Constant Field Values

DAILY

public static final java.lang.String DAILY
See Also:
Constant Field Values

WEEKLY

public static final java.lang.String WEEKLY
See Also:
Constant Field Values

MONTHLY

public static final java.lang.String MONTHLY
See Also:
Constant Field Values

YEARLY

public static final java.lang.String YEARLY
See Also:
Constant Field Values
Constructor Detail

Recur

public Recur(java.lang.String aValue)
      throws java.text.ParseException
Constructs a new instance from the specified string value.

Parameters:
aValue - a string representation of a recurrence.
Throws:
java.text.ParseException - thrown when the specified string contains an invalid representation of an UNTIL date value
java.lang.IllegalArgumentException - if the frequency is null or unrecognized.

Recur

public Recur(java.lang.String frequency,
             Date until)
Parameters:
frequency -
until -
Throws:
java.lang.IllegalArgumentException - if the frequency is null or unrecognized.

Recur

public Recur(java.lang.String frequency,
             int count)
Parameters:
frequency -
count -
Throws:
java.lang.IllegalArgumentException - if the frequency is null or unrecognized.
Method Detail

getDayList

public final WeekDayList getDayList()
Returns:
Returns the dayList.

getHourList

public final NumberList getHourList()
Returns:
Returns the hourList.

getMinuteList

public final NumberList getMinuteList()
Returns:
Returns the minuteList.

getMonthDayList

public final NumberList getMonthDayList()
Returns:
Returns the monthDayList.

getMonthList

public final NumberList getMonthList()
Returns:
Returns the monthList.

getSecondList

public final NumberList getSecondList()
Returns:
Returns the secondList.

getSetPosList

public final NumberList getSetPosList()
Returns:
Returns the setPosList.

getWeekNoList

public final NumberList getWeekNoList()
Returns:
Returns the weekNoList.

getYearDayList

public final NumberList getYearDayList()
Returns:
Returns the yearDayList.

getCount

public final int getCount()
Returns:
Returns the count.

getExperimentalValues

public final java.util.Map getExperimentalValues()
Returns:
Returns the experimentalValues.

getFrequency

public final java.lang.String getFrequency()
Returns:
Returns the frequency.

getInterval

public final int getInterval()
Returns:
Returns the interval.

getUntil

public final Date getUntil()
Returns:
Returns the until.

getWeekStartDay

public final java.lang.String getWeekStartDay()
Returns:
Returns the weekStartDay.

setWeekStartDay

public final void setWeekStartDay(java.lang.String weekStartDay)
Parameters:
weekStartDay - The weekStartDay to set.

toString

public final java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

getDates

public final DateList getDates(Date periodStart,
                               Date periodEnd,
                               Value value)
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 period
periodEnd - the end of the period
value - the type of dates to generate (i.e. date/date-time)
Returns:
a list of dates

getDates

public final DateList getDates(Date seed,
                               Period period,
                               Value value)
Convenience method for retrieving recurrences in a specified period.

Parameters:
period - the period of returned recurrence dates
value - type of dates to generate
Returns:
a list of dates

getDates

public final DateList getDates(Date seed,
                               Date periodStart,
                               Date periodEnd,
                               Value value)
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 instance
periodStart - the start of the period
periodEnd - the end of the period
value - 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 instance
periodStart - the start of the period
periodEnd - the end of the period
value - 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

setCount

public final void setCount(int count)
Parameters:
count - The count to set.

setFrequency

public final void setFrequency(java.lang.String frequency)
Parameters:
frequency - The frequency to set.
Throws:
java.lang.IllegalArgumentException - if the frequency is null or unrecognized.

setInterval

public final void setInterval(int interval)
Parameters:
interval - The interval to set.

setUntil

public final void setUntil(Date until)
Parameters:
until - The until to set.


Copyright © 2004-2007 Modularity. All Rights Reserved.