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. This property must contain either dates or time periods. It cannot contain a combination of both.

Examples:

 //date-time values
 Date one = ...
 Date two = ...
 List<Date> dates = Arrays.asList(one, two);
 RecurrenceDates prop = new RecurrenceDates(dates, true);
 
 //date values
 Date one = ...
 Date two = ...
 List<Date> dates = Arrays.asList(one, two);
 RecurrenceDates prop = new RecurrenceDates(dates, false);
 
 //periods
 Period one = ...
 Period two = ...
 List<Period> periods = Arrays.asList(one, two);
 RecurrenceDates prop = new RecurrenceDates(periods, true);
 

Author:
Michael Angstadt
See Also:
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 property's timezone in the form of a globally-defined timezone (e.g.
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, getAltRepresentation, getCommonName, getDirectoryEntry, getFormatType, getLanguage, getParameter, getParameters, getParameters, getSentBy, removeParameter, setAltRepresentation, setCommonName, setDirectoryEntry, setFormatType, setLanguage, setParameter, setParameter, setParameters, setSentBy, 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.

Overrides:
getTimezoneId in class ICalProperty
Returns:
the timezone identifier or null if not set
See Also:
RFC 5545 p.27-8

setTimezoneId

public void setTimezoneId(String timezoneId)
Description copied from class: ICalProperty
Sets the property's timezone in the form of a globally-defined timezone (e.g. "America/New_York"). For a list of globally-defined timezones, see the TZ database. Use ICalProperty.setTimezone(VTimezone) to use a timezone that's defined within the iCalendar object.

Overrides:
setTimezoneId in class ICalProperty
Parameters:
timezoneId - the timezone identifier (e.g. "America/New_York") or null to remove
See Also:
RFC 5545 p.27-8

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").

Overrides:
setTimezone in class ICalProperty
Parameters:
timezone - the timezone component or null to remove
See Also:
RFC 5545 p.27-8

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.

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.