public class RecurrenceDates extends ICalProperty
Defines a list of dates or time periods that help define a recurrence rule. It must contain either dates or time periods. It cannot contain a combination of both.
Code sample:
VEvent event = new VEvent(); //date-time values Date datetime1 = ... Date datetime2 = ... List<Date> datetimes = Arrays.asList(datetime1, datetime2); RecurrenceDates rdate = new RecurrenceDates(datetimes, true); event.addRecurrenceDates(rdate); //date values Date date1 = ... Date date2 = ... List<Date> dates = Arrays.asList(date1, date2); rdate = new RecurrenceDates(dates, false); event.addRecurrenceDates(rdate); //periods Period period1 = ... Period period2 = ... List<Period> periods = Arrays.asList(period1, period2); rdate = new RecurrenceDates(periods, true); event.addRecurrenceDates(rdate);
parameters
Constructor and Description |
---|
RecurrenceDates(List<Date> dates,
boolean hasTime)
Creates a recurrence dates property.
|
RecurrenceDates(List<Period> periods)
Creates a recurrence dates property.
|
Modifier and Type | Method and Description |
---|---|
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<Warning> warnings)
Checks the property for data consistency problems or deviations from the
spec.
|
addParameter, getParameter, getParameters, getParameters, removeParameter, setParameter, setParameter, setParameters, validate
public RecurrenceDates(List<Date> dates, boolean hasTime)
dates
- the recurrence dateshasTime
- true if the dates have a time component, false if they are
strictly datespublic RecurrenceDates(List<Period> periods)
periods
- the time periodspublic List<Date> getDates()
public boolean hasTime()
public List<Period> getPeriods()
public String getTimezoneId()
ICalProperty
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.public void setTimezoneId(String timezoneId)
ICalProperty
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.timezoneId
- the timezone identifier (e.g. "America/New_York") or
null to removepublic void setTimezone(VTimezone timezone)
ICalProperty
ICalProperty.setTimezoneId(String)
to use a
globally-defined timezone (e.g. "America/New_York").timezone
- the timezone component to reference or null to removeprotected void validate(List<ICalComponent> components, List<Warning> warnings)
ICalProperty
validate
in class ICalProperty
components
- the hierarchy of components that the property belongs
towarnings
- the list to add the warnings toCopyright © 2013-2014 Michael Angstadt. All Rights Reserved.