4.6.1 Event Component
Component Name: "VEVENT"
Purpose: Provide a grouping of component properties that describe an
event.
Format Definition: A "VEVENT" calendar component is defined by the
following notation:
eventc = "BEGIN" ":" "VEVENT" CRLF
eventprop *alarmc
"END" ":" "VEVENT" CRLF
eventprop = *(
; the following are optional,
; but MUST NOT occur more than once
class / created / description / dtstart / geo /
last-mod / location / organizer / priority /
dtstamp / seq / status / summary / transp /
uid / url / recurid /
; either 'dtend' or 'duration' may appear in
; a 'eventprop', but 'dtend' and 'duration'
; MUST NOT occur in the same 'eventprop'
dtend / duration /
; the following are optional,
; and MAY occur more than once
attach / attendee / categories / comment /
contact / exdate / exrule / rstatus / related /
resources / rdate / rrule / x-prop
)
Example 1 - Creating a new all-day event:
java.util.Calendar cal = java.util.Calendar.getInstance();
cal.set(java.util.Calendar.MONTH, java.util.Calendar.DECEMBER);
cal.set(java.util.Calendar.DAY_OF_MONTH, 25);
VEvent christmas = new VEvent(cal.getTime(), "Christmas Day");
// initialise as an all-day event..
christmas.getProperties().getProperty(Property.DTSTART).getParameters().add(
Value.DATE);
// add timezone information..
VTimeZone tz = VTimeZone.getDefault();
TzId tzParam = new TzId(tz.getProperties().getProperty(Property.TZID)
.getValue());
christmas.getProperties().getProperty(Property.DTSTART).getParameters().add(
tzParam);
Example 2 - Creating an event of one (1) hour duration:
java.util.Calendar cal = java.util.Calendar.getInstance();
// tomorrow..
cal.add(java.util.Calendar.DAY_OF_MONTH, 1);
cal.set(java.util.Calendar.HOUR_OF_DAY, 9);
cal.set(java.util.Calendar.MINUTE, 30);
VEvent meeting = new VEvent(cal.getTime(), 1000 * 60 * 60, "Progress Meeting");
// add timezone information..
VTimeZone tz = VTimeZone.getDefault();
TzId tzParam = new TzId(tz.getProperties().getProperty(Property.TZID)
.getValue());
meeting.getProperties().getProperty(Property.DTSTART).getParameters().add(
tzParam);
Example 3 - Retrieve a list of periods representing a recurring event in a specified range:
Calendar weekday9AM = Calendar.getInstance();
weekday9AM.set(2005, Calendar.MARCH, 7, 9, 0, 0);
weekday9AM.set(Calendar.MILLISECOND, 0);
Calendar weekday5PM = Calendar.getInstance();
weekday5PM.set(2005, Calendar.MARCH, 7, 17, 0, 0);
weekday5PM.set(Calendar.MILLISECOND, 0);
// Do the recurrence until December 31st.
Calendar untilCal = Calendar.getInstance();
untilCal.set(2005, Calendar.DECEMBER, 31);
untilCal.set(Calendar.MILLISECOND, 0);
// 9:00AM to 5:00PM Rule
Recur recur = new Recur(Recur.WEEKLY, untilCal.getTime());
recur.getDayList().add(WeekDay.MO);
recur.getDayList().add(WeekDay.TU);
recur.getDayList().add(WeekDay.WE);
recur.getDayList().add(WeekDay.TH);
recur.getDayList().add(WeekDay.FR);
recur.setInterval(3);
recur.setWeekStartDay(WeekDay.MO.getDay());
RRule rrule = new RRule(recur);
Summary summary = new Summary("TEST EVENTS THAT HAPPEN 9-5 MON-FRI");
weekdayNineToFiveEvents = new VEvent();
weekdayNineToFiveEvents.add(rrule);
weekdayNineToFiveEvents.add(summary);
weekdayNineToFiveEvents.add(new DtStart(weekday9AM.getTime()));
weekdayNineToFiveEvents.add(new DtEnd(weekday5PM.getTime()));
// Test Start 04/01/2005, End One month later.
// Query Calendar Start and End Dates.
Calendar queryStartDate = Calendar.getInstance();
queryStartDate.set(2005, Calendar.APRIL, 1, 14, 47, 0);
queryStartDate.set(Calendar.MILLISECOND, 0);
Calendar queryEndDate = Calendar.getInstance();
queryEndDate.set(2005, Calendar.MAY, 1, 11, 15, 0);
queryEndDate.set(Calendar.MILLISECOND, 0);
// This range is monday to friday every three weeks, starting from
// March 7th 2005, which means for our query dates we need
// April 18th through to the 22nd.
PeriodList periods = weekdayNineToFiveEvents.getPeriods(queryStartDate
.getTime(), queryEndDate.getTime());
| Modifier and Type | Class and Description |
|---|---|
| public static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final Map | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | |
| public | VEvent(final PropertyList
a list of properties properties, final ComponentList<VAlarm> a list of alarms alarms)Constructor. |
| public | |
| public | |
| public | VEvent(final Temporal
the start date of the new event start, final TemporalAmount the duration of the new event duration, final String the event summary summary)Constructs a new VEVENT instance starting at the specified times, for the specified duration, with the specified summary. |
| Modifier and Type | Method and Description |
|---|---|
| public VEvent | copy()
Overrides net. Implements net. Create a (deep) copy of this component. |
| public boolean | equals(final Object
the reference object with which to compare. arg0)Overrides net. Indicates whether some other object is "equal to" this one. |
| public ComponentList | |
| public final <T extends Temporal> List | Returns: a normalised list of periods representing consumed time for this eventthe range to check for consumed time range)Returns a normalised list of periods representing the consumed time for this event. |
| public final <T extends Temporal> List | Returns: a list of periods representing consumed time for this eventthe range to check for consumed time range, final boolean indicate whether the returned list of periods should be normalised normalise)Returns a list of periods representing the consumed time for this event in the specified range. |
| public final Optional | Returns: the optional date-stamp property
Deprecated
use
ChangeManagementPropertyAccessor#getDateTimeStamp()
|
| public final <T extends Temporal> Optional | Returns: a DtEnd instance, or null if one cannot be derivedReturns the end date of this event. |
| public final <T extends Temporal> Optional | Returns: The end for this VEVENT.specifies whether to derive an end date from the event duration where an end date is
not found deriveFromDuration)Convenience method to pull the DTEND out of the property list. |
| public final <T extends Temporal> VEvent | Returns: a single non-recurring event instance for the specified date, or null if the event doesn't occur on the specified datea date on which the occurence should occur date)
Deprecated
use
RecurrenceSupport#getOccurrences(Period)
Returns a single occurrence of a recurring event. |
| public final <T extends Temporal> Optional | Returns: The DtStart object representation of the start Date
Deprecated
use
DateTimePropertyAccessor#getDateTimeStart()
Convenience method to pull the DTSTART out of the property list. |
| public final Optional | Returns: the optional time transparency property for an event
Deprecated
use
DateTimePropertyAccessor#getTimeTransparency()
|
| public int | hashCode()
Overrides net. Returns a hash code value for this object. |
| protected ComponentFactory | newFactory()
Implements abstract net. Returns a new component factory used to create deep copies. |
| public void | setComponentList(ComponentList<Component> components)
Implements net.
|
| public ValidationResult | validate(final boolean
indicates whether to validate the component's properties recurse)Implements abstract net. Perform validation on a component. |
| public ValidationResult | validate(Method
the applicable method method)Overrides net. Performs method-specific ITIP validation. |
| methodValidators | back to summary |
|---|---|
| private static final Map<Method, Validator<VEvent>> methodValidators | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides net. | |
| VEvent | back to summary |
|---|---|
| public VEvent() Default constructor. | |
| VEvent | back to summary |
|---|---|
| public VEvent(boolean initialise) | |
| VEvent | back to summary |
|---|---|
| public VEvent(final PropertyList properties) Constructor.
| |
| VEvent | back to summary |
|---|---|
| public VEvent(final PropertyList properties, final ComponentList<VAlarm> alarms) Constructor.
| |
| VEvent | back to summary |
|---|---|
| public VEvent(final Temporal start, final String summary) Constructs a new VEVENT instance starting at the specified time with the specified summary. | |
| VEvent | back to summary |
|---|---|
| public VEvent(final Temporal start, final Temporal end, final String summary) Constructs a new VEVENT instance starting and ending at the specified times with the specified summary. | |
| VEvent | back to summary |
|---|---|
| public VEvent(final Temporal start, final TemporalAmount duration, final String summary) Constructs a new VEVENT instance starting at the specified times, for the specified duration, with the specified summary.
| |
| copy | back to summary |
|---|---|
| public VEvent copy() Overrides net. Implements net. Doc from net. Create a (deep) copy of this component. | |
| equals | back to summary |
|---|---|
| public boolean equals(final Object arg0) Overrides net. Doc from net. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
| |
| getComponentList | back to summary |
|---|---|
| public ComponentList Implements net.
| |
| getConsumedTime | back to summary |
|---|---|
| public final <T extends Temporal> List Returns a normalised list of periods representing the consumed time for this event. | |
| getConsumedTime | back to summary |
|---|---|
| public final <T extends Temporal> List Returns a list of periods representing the consumed time for this event in the specified range. Note that the returned list may contain a single period for non-recurring components or multiple periods for recurring components. If no time is consumed by this event an empty list is returned. | |
| getDateStamp | back to summary |
|---|---|
| public final Optional Deprecated | |
| getEndDate | back to summary |
|---|---|
| public final <T extends Temporal> Optional Returns the end date of this event. Where an end date is not available it will be derived from the event duration. | |
| getEndDate | back to summary |
|---|---|
| public final <T extends Temporal> Optional Convenience method to pull the DTEND out of the property list. If DTEND was not specified, use the DTSTART + DURATION to calculate it. | |
| getOccurrence | back to summary |
|---|---|
| public final <T extends Temporal> VEvent getOccurrence(final T date)
Deprecated Returns a single occurrence of a recurring event.
| |
| getStartDate | back to summary |
|---|---|
| public final <T extends Temporal> Optional Deprecated Convenience method to pull the DTSTART out of the property list. | |
| getTransparency | back to summary |
|---|---|
| public final Optional Deprecated | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides net. Doc from net. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| newFactory | back to summary |
|---|---|
| protected ComponentFactory Implements abstract net. Doc from net. Returns a new component factory used to create deep copies.
| |
| setComponentList | back to summary |
|---|---|
| public void setComponentList(ComponentList<Component> components) Implements net.
| |
| validate | back to summary |
|---|---|
| public ValidationResult validate(final boolean recurse) throws ValidationException Implements abstract net. Doc from net. Perform validation on a component.
| |
| validate | back to summary |
|---|---|
| public ValidationResult validate(Method method) throws ValidationException Overrides net. Performs method-specific ITIP validation.
| |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public VEvent | |
| public VEvent | createComponent(PropertyList properties)
Implements net.
|
| public VEvent | createComponent(PropertyList properties, ComponentList<?> subComponents)
Overrides default net.
|
| Factory | back to summary |
|---|---|
| public Factory() | |
| createComponent | back to summary |
|---|---|
| public VEvent createComponent() Implements net.
| |
| createComponent | back to summary |
|---|---|
| public VEvent createComponent(PropertyList properties) Implements net.
| |
| createComponent | back to summary |
|---|---|
| public VEvent createComponent(PropertyList properties, ComponentList<?> subComponents) Overrides default net.
| |