Class VAlarm
- java.lang.Object
-
- net.fortuna.ical4j.model.Content
-
- net.fortuna.ical4j.model.Component
-
- net.fortuna.ical4j.model.component.CalendarComponent
-
- net.fortuna.ical4j.model.component.VAlarm
-
- All Implemented Interfaces:
Serializable
,FluentComponent
,PropertyContainer
public class VAlarm extends CalendarComponent
$Id$ [Apr 5, 2004] Defines an iCalendar VALARM component.4.6.6 Alarm Component Component Name: VALARM Purpose: Provide a grouping of component properties that define an alarm. Formal Definition: A "VALARM" calendar component is defined by the following notation: alarmc = "BEGIN" ":" "VALARM" CRLF (audioprop / dispprop / emailprop / procprop) "END" ":" "VALARM" CRLF audioprop = 2*( ; 'action' and 'trigger' are both REQUIRED, ; but MUST NOT occur more than once action / trigger / ; 'duration' and 'repeat' are both optional, ; and MUST NOT occur more than once each, ; but if one occurs, so MUST the other duration / repeat / ; the following is optional, ; but MUST NOT occur more than once attach / ; the following is optional, ; and MAY occur more than once x-prop ) dispprop = 3*( ; the following are all REQUIRED, ; but MUST NOT occur more than once action / description / trigger / ; 'duration' and 'repeat' are both optional, ; and MUST NOT occur more than once each, ; but if one occurs, so MUST the other duration / repeat / ; the following is optional, ; and MAY occur more than once *x-prop ) emailprop = 5*( ; the following are all REQUIRED, ; but MUST NOT occur more than once action / description / trigger / summary ; the following is REQUIRED, ; and MAY occur more than once attendee / ; 'duration' and 'repeat' are both optional, ; and MUST NOT occur more than once each, ; but if one occurs, so MUST the other duration / repeat / ; the following are optional, ; and MAY occur more than once attach / x-prop ) procprop = 3*( ; the following are all REQUIRED, ; but MUST NOT occur more than once action / attach / trigger / ; 'duration' and 'repeat' are both optional, ; and MUST NOT occur more than once each, ; but if one occurs, so MUST the other duration / repeat / ; 'description' is optional, ; and MUST NOT occur more than once description / ; the following is optional, ; and MAY occur more than once x-prop )
Example 1 - Creating an alarm to trigger at a specific time:
Example 2 - Creating an alarm to trigger one (1) hour before the scheduled start of the parent event/the parent todo is due: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); VAlarm christmas = new VAlarm(cal.getTime());
VAlarm reminder = new VAlarm(new Dur(0, -1, 0, 0)); // repeat reminder four (4) more times every fifteen (15) minutes.. reminder.add(new Repeat(4)); reminder.add(new Duration(new Dur(0, 0, 15, 0))); // display a message.. reminder.add(Action.DISPLAY); reminder.add(new Description("Progress Meeting at 9:30am"));
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VAlarm.Factory
-
Field Summary
-
Fields inherited from class net.fortuna.ical4j.model.component.CalendarComponent
EMPTY_VALIDATOR
-
Fields inherited from class net.fortuna.ical4j.model.Component
AVAILABLE, BEGIN, components, END, EXPERIMENTAL_PREFIX, PARTICIPANT, properties, VALARM, VAVAILABILITY, VEVENT, VFREEBUSY, VJOURNAL, VLOCATION, VRESOURCE, VTIMEZONE, VTODO, VVENUE
-
-
Constructor Summary
Constructors Constructor Description VAlarm()
Default constructor.VAlarm(Instant trigger)
Constructs a new VALARM instance that will trigger at the specified time.VAlarm(TemporalAmount trigger)
Constructs a new VALARM instance that will trigger at the specified time relative to the event/todo component.VAlarm(PropertyList properties)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Optional<Action>
getAction()
Deprecated.Optional<Attach>
getAttachment()
Deprecated.Optional<Description>
getDescription()
Deprecated.Optional<Duration>
getDuration()
Deprecated.Optional<Repeat>
getRepeat()
Deprecated.Optional<Summary>
getSummary()
Deprecated.Optional<Trigger>
getTrigger()
Deprecated.protected ComponentFactory<VAlarm>
newFactory()
Returns a new component factory used to create deep copies.ValidationResult
validate(boolean recurse)
Perform validation on a component.-
Methods inherited from class net.fortuna.ical4j.model.component.CalendarComponent
validate, validateAdd, validateCancel, validateCounter, validateDeclineCounter, validatePublish, validateRefresh, validateReply, validateRequest
-
Methods inherited from class net.fortuna.ical4j.model.Component
calculateRecurrenceSet, copy, equals, getFluentTarget, getName, getProperties, getPropertyList, getValue, hashCode, setPropertyList, toString, validate, validateProperties
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.fortuna.ical4j.model.FluentComponent
withProperty
-
Methods inherited from interface net.fortuna.ical4j.model.PropertyContainer
add, addAll, getProperties, getProperty, getRequiredProperty, remove, removeAll, replace
-
-
-
-
Constructor Detail
-
VAlarm
public VAlarm()
Default constructor.
-
VAlarm
public VAlarm(PropertyList properties)
Constructor.- Parameters:
properties
- a list of properties
-
VAlarm
public VAlarm(Instant trigger)
Constructs a new VALARM instance that will trigger at the specified time.- Parameters:
trigger
- the time the alarm will trigger
-
VAlarm
public VAlarm(TemporalAmount trigger)
Constructs a new VALARM instance that will trigger at the specified time relative to the event/todo component.- Parameters:
trigger
- a duration of time relative to the parent component that the alarm will trigger at
-
-
Method Detail
-
validate
public ValidationResult validate(boolean recurse) throws ValidationException
Perform validation on a component.- Specified by:
validate
in classComponent
- Parameters:
recurse
- indicates whether to validate the component's properties- Throws:
ValidationException
- where the component is not in a valid state
-
getAction
@Deprecated public final Optional<Action> getAction()
Deprecated.Returns the mandatory action property.- Returns:
- the ACTION property or null if not specified
-
getTrigger
@Deprecated public final Optional<Trigger> getTrigger()
Deprecated.Returns the mandatory trigger property.- Returns:
- the TRIGGER property or null if not specified
-
getDuration
@Deprecated public final Optional<Duration> getDuration()
Deprecated.Returns the optional duration property.- Returns:
- the DURATION property or null if not specified
-
getRepeat
@Deprecated public final Optional<Repeat> getRepeat()
Deprecated.Returns the optional repeat property.- Returns:
- the REPEAT property or null if not specified
-
getAttachment
@Deprecated public final Optional<Attach> getAttachment()
Deprecated.Returns the optional attachment property.- Returns:
- the ATTACH property or null if not specified
-
getDescription
@Deprecated public final Optional<Description> getDescription()
Deprecated.Returns the optional description property.- Returns:
- the DESCRIPTION property or null if not specified
-
getSummary
@Deprecated public final Optional<Summary> getSummary()
Deprecated.Returns the optional summary property.- Returns:
- the SUMMARY property or null if not specified
-
newFactory
protected ComponentFactory<VAlarm> newFactory()
Description copied from class:Component
Returns a new component factory used to create deep copies.- Specified by:
newFactory
in classComponent
- Returns:
- a component factory instance
-
-