Top Description Inners Fields Constructors Methods
net.fortuna.ical4j.model.component

public Class VAlarm

extends Component
implements Prototype<VAlarm>, ComponentContainer<Component>, DescriptivePropertyAccessor, LocationsAccessor
Class Inheritance
All Implemented Interfaces
net.fortuna.ical4j.model.LocationsAccessor, net.fortuna.ical4j.model.ComponentContainer, net.fortuna.ical4j.model.ComponentListAccessor, net.fortuna.ical4j.model.DescriptivePropertyAccessor, net.fortuna.ical4j.model.PropertyContainer, net.fortuna.ical4j.model.PropertyListAccessor, net.fortuna.ical4j.model.Prototype
Imports
net.fortuna.ical4j.model.*, net.fortuna.ical4j.model.property.*, net.fortuna.ical4j.validate.ComponentValidator, .ValidationException, .ValidationResult, java.time.Instant, java.time.temporal.TemporalAmount, java.util.Optional, java.util.stream.Collectors

$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:

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());
Example 2 - Creating an alarm to trigger one (1) hour before the scheduled start of the parent event/the parent todo is due:

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"));
Author
Ben Fortuna

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
private static final long
Inherited from net.fortuna.ical4j.model.Component:
AVAILABLEBEGINcomponentsENDEXPERIMENTAL_PREFIXPARTICIPANTpropertiesVALARMVAVAILABILITYVEVENTVFREEBUSYVJOURNALVLOCATIONVRESOURCEVTIMEZONEVTODOVVENUE

Constructor Summary

AccessConstructor and Description
public
VAlarm()

Default constructor.

public
VAlarm(final PropertyList
a list of properties
properties
)

Constructor.

public
VAlarm(final Instant
the time the alarm will trigger
trigger
)

Constructs a new VALARM instance that will trigger at the specified time.

public
VAlarm(final TemporalAmount
a duration of time relative to the parent component that the alarm will trigger at
trigger
)

Constructs a new VALARM instance that will trigger at the specified time relative to the event/todo component.

Method Summary

Modifier and TypeMethod and Description
public VAlarm
copy()

Overrides net.fortuna.ical4j.model.Component.copy.

Implements net.fortuna.ical4j.model.Prototype.copy.

Create a (deep) copy of this component.

public final Optional<Action>

Returns:

the ACTION property or null if not specified
getAction
()

Returns the mandatory action property.

public final Optional<Attach>

Returns:

the ATTACH property or null if not specified
getAttachment
()

Returns the optional attachment property.

public ComponentList<Component>

Returns:

Returns the underlying component list.
getComponentList
()

Implements net.fortuna.ical4j.model.ComponentListAccessor.getComponentList.

public final Optional<Duration>

Returns:

the DURATION property or null if not specified
getDuration
()

Returns the optional duration property.

public final Optional<Repeat>

Returns:

the REPEAT property or null if not specified
getRepeat
()

Returns the optional repeat property.

public final Optional<Trigger>

Returns:

the TRIGGER property or null if not specified
getTrigger
()

Returns the mandatory trigger property.

protected ComponentFactory<VAlarm>
newFactory()

Implements abstract net.fortuna.ical4j.model.Component.newFactory.

Returns a new component factory used to create deep copies.

public void
public ValidationResult
validate(final boolean
indicates whether to validate the component's properties
recurse
)

Implements abstract net.fortuna.ical4j.model.Component.validate.

Perform validation on a component.

Inherited from net.fortuna.ical4j.model.Component:
calculateRecurrenceSetcompareToequalsgetFluentTargetgetNamegetPropertiesgetPropertyListgetUidgetValuehashCodesetPropertyListtoStringvalidatevalidateProperties

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides net.fortuna.ical4j.model.Component.serialVersionUID.

Constructor Detail

VAlarmback to summary
public VAlarm()

Default constructor.

VAlarmback to summary
public VAlarm(final PropertyList properties)

Constructor.

Parameters
properties:PropertyList

a list of properties

VAlarmback to summary
public VAlarm(final Instant trigger)

Constructs a new VALARM instance that will trigger at the specified time.

Parameters
trigger:Instant

the time the alarm will trigger

VAlarmback to summary
public VAlarm(final TemporalAmount trigger)

Constructs a new VALARM instance that will trigger at the specified time relative to the event/todo component.

Parameters
trigger:TemporalAmount

a duration of time relative to the parent component that the alarm will trigger at

Method Detail

copyback to summary
public VAlarm copy()

Overrides net.fortuna.ical4j.model.Component.copy.

Implements net.fortuna.ical4j.model.Prototype.copy.

Doc from net.fortuna.ical4j.model.Component.copy.

Create a (deep) copy of this component.

Returns:VAlarm

the component copy

Annotations
@Override
getActionback to summary
public final Optional<Action> getAction()

Returns the mandatory action property.

Returns:Optional<Action>

the ACTION property or null if not specified

Annotations
@Deprecated
getAttachmentback to summary
public final Optional<Attach> getAttachment()

Returns the optional attachment property.

Returns:Optional<Attach>

the ATTACH property or null if not specified

Annotations
@Deprecated
getComponentListback to summary
public ComponentList<Component> getComponentList()

Implements net.fortuna.ical4j.model.ComponentListAccessor.getComponentList.

Returns:ComponentList<Component>

Returns the underlying component list.

Annotations
@Override
getDurationback to summary
public final Optional<Duration> getDuration()

Returns the optional duration property.

Returns:Optional<Duration>

the DURATION property or null if not specified

Annotations
@Deprecated
getRepeatback to summary
public final Optional<Repeat> getRepeat()

Returns the optional repeat property.

Returns:Optional<Repeat>

the REPEAT property or null if not specified

Annotations
@Deprecated
getTriggerback to summary
public final Optional<Trigger> getTrigger()

Returns the mandatory trigger property.

Returns:Optional<Trigger>

the TRIGGER property or null if not specified

Annotations
@Deprecated
newFactoryback to summary
protected ComponentFactory<VAlarm> newFactory()

Implements abstract net.fortuna.ical4j.model.Component.newFactory.

Doc from net.fortuna.ical4j.model.Component.newFactory.

Returns a new component factory used to create deep copies.

Returns:ComponentFactory<VAlarm>

a component factory instance

Annotations
@Override
setComponentListback to summary
public void setComponentList(ComponentList<Component> components)

Implements net.fortuna.ical4j.model.ComponentContainer.setComponentList.

Annotations
@Override
validateback to summary
public ValidationResult validate(final boolean recurse) throws ValidationException

Implements abstract net.fortuna.ical4j.model.Component.validate.

Doc from net.fortuna.ical4j.model.Component.validate.

Perform validation on a component.

Parameters
recurse:boolean

indicates whether to validate the component's properties

Annotations
@Override
Exceptions
ValidationException:
where the component is not in a valid state
net.fortuna.ical4j.model.component back to summary

public Class VAlarm.Factory

extends Factory
implements ComponentFactory<VAlarm>
Class Inheritance
All Implemented Interfaces
net.fortuna.ical4j.model.ComponentFactory

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public VAlarm
public VAlarm
Inherited from net.fortuna.ical4j.model.Content.Factory:
supports

Constructor Detail

Factoryback to summary
public Factory()

Method Detail

createComponentback to summary
public VAlarm createComponent()

Implements net.fortuna.ical4j.model.ComponentFactory.createComponent.

Annotations
@Override
createComponentback to summary
public VAlarm createComponent(PropertyList properties)

Implements net.fortuna.ical4j.model.ComponentFactory.createComponent.

Annotations
@Override