biweekly.property
Class RecurrenceDates

java.lang.Object
  extended by biweekly.property.ICalProperty
      extended by biweekly.property.RecurrenceDates

public class RecurrenceDates
extends ICalProperty

Defines a list of dates or periods that help define a recurrence rule. It must contain either dates or time periods. It cannot contain a combination of both.

Examples:

 //date-time values
 Date datetime1 = ...
 Date datetime2 = ...
 List<Date> datetimes = Arrays.asList(datetime1, datetime2);
 RecurrenceDates prop = new RecurrenceDates(datetimes, true);
 
 //date values
 Date date1 = ...
 Date date2 = ...
 List<Date> dates = Arrays.asList(date1, date2);
 RecurrenceDates prop = new RecurrenceDates(dates, false);
 
 //periods
 Period period1 = ...
 Period period2 = ...
 List<Period> periods = Arrays.asList(period1, period2);
 RecurrenceDates prop = new RecurrenceDates(periods, true);
 

Author:
Michael Angstadt
Specification Reference:
RFC 5545 p.120-2

Field Summary
 
Fields inherited from class biweekly.property.ICalProperty
parameters
 
Constructor Summary
RecurrenceDates(List<Date> dates, boolean hasTime)
          Creates a recurrence dates property.
RecurrenceDates(List<Period> periods)
          Creates a recurrence dates property.
 
Method Summary
 List<Date> getDates()
          Gets the recurrence dates.
 List<Period> getPeriods()
          Gets the time periods.
 String getTimezoneId()
          Gets the timezone identifier.
 boolean hasTime()
          Gets whether the recurrence dates have time components.
 void setTimezone(VTimezone timezone)
          Sets the property's timezone to a timezone that is defined within the iCalendar object.
 void setTimezoneId(String timezoneId)
          Sets the timezone identifier.
protected  void validate(List<ICalComponent> components, List<String> warnings)
          Checks the property for data consistency problems or deviations from the spec.
 
Methods inherited from class biweekly.property.ICalProperty
addParameter, getParameter, getParameters, getParameters, removeParameter, setParameter, setParameter, setParameters, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RecurrenceDates

public RecurrenceDates(List<Date> dates,
                       boolean hasTime)
Creates a recurrence dates property.

Parameters:
dates - the recurrence dates
hasTime - true if the dates have a time component, false if they are strictly dates

RecurrenceDates

public RecurrenceDates(List<Period> periods)
Creates a recurrence dates property.

Parameters:
periods - the time periods
Method Detail

getDates

public List<Date> getDates()
Gets the recurrence dates.

Returns:
the dates or null if this property contains periods

hasTime

public boolean hasTime()
Gets whether the recurrence dates have time components.

Returns:
true if the dates have a time component, false if they are strictly dates

getPeriods

public List<Period> getPeriods()
Gets the time periods.

Returns:
the time periods or null if this property contains dates

getTimezoneId

public String getTimezoneId()
Description copied from class: ICalProperty
Gets the timezone identifier. This either (a) references the TimezoneId property of a VTimezone component, or (b) specifies a globally-defined timezone (e.g. "America/New_York"). For a list of globally-defined timezones, see the TZ database.

Returns:
the timezone identifier or null if not set

setTimezoneId

public void setTimezoneId(String timezoneId)
Description copied from class: ICalProperty
Sets the timezone identifier. This either (a) references the TimezoneId property of a VTimezone component, or (b) specifies a globally-defined timezone (e.g. "America/New_York"). For a list of globally-defined timezones, see the TZ database.

Parameters:
timezoneId - the timezone identifier (e.g. "America/New_York") or null to remove

setTimezone

public void setTimezone(VTimezone timezone)
Description copied from class: ICalProperty
Sets the property's timezone to a timezone that is defined within the iCalendar object. Use ICalProperty.setTimezoneId(String) to use a globally-defined timezone (e.g. "America/New_York").

Parameters:
timezone - the timezone component to reference or null to remove

validate

protected void validate(List<ICalComponent> components,
                        List<String> warnings)
Description copied from class: ICalProperty
Checks the property for data consistency problems or deviations from the spec. Meant to be overridden by child classes that wish to provide validation logic.

Overrides:
validate in class ICalProperty
Parameters:
components - the hierarchy of components that the property belongs to
warnings - the list to add the warnings to


Copyright © 2013 Michael Angstadt. All Rights Reserved.