java.lang.Object
org.bzdev.net.calendar.ICalBuilder.Base
org.bzdev.net.calendar.ICalBuilder.Alarm
- Enclosing class:
- ICalBuilder
The iCalendar alarm component class.
Please see
Section 3.6.6 of RFC 5545 for a description of the iCalendar
alarm component.
-
Field Summary
Fields inherited from class org.bzdev.net.calendar.ICalBuilder.Base
contentLines
-
Constructor Summary
ConstructorsConstructorDescriptionAlarm
(ICalBuilder.CommonWithAlarm parent, int offset, ICalBuilder.AlarmType type, boolean fromStart) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Generate content lines.void
repeat
(int repeat, int duration) Set the repeat count and the corresponding duration.void
setDescription
(String description, String... parameters) Set the description for this alarm.void
setSummary
(String summary, String... parameters) Set the summary field for this alarm.Methods inherited from class org.bzdev.net.calendar.ICalBuilder.Base
addAttachment, addAttachment, addProperty, addProperty, addProperty, clearContentLines, setDuration
-
Constructor Details
-
Alarm
public Alarm(ICalBuilder.CommonWithAlarm parent, int offset, ICalBuilder.AlarmType type, boolean fromStart) throws IllegalArgumentException Constructor.- Parameters:
parent
- the iCalendar component to which this alarm is attachedoffset
- the offset from the starting or ending time of an event in units of minutes.type
- the type of the alarm (ICalBuilder.AlarmType.AUDIO
,ICalBuilder.AlarmType.DISPLAY
, orICalBuilder.AlarmType.EMAIL
).fromStart
- true if the alarm is offset from the start of the event; false if the alarm is offset from the end of the event;- Throws:
IllegalArgumentException
-
-
Method Details
-
setSummary
Set the summary field for this alarm. The use of this method is optional: defaults will be provided if this method is not used, provided that a summary was provided in the enclosing component. The mandatory argument is typically a short string describing an event and is described in Section 3.8.1.12 of RFC 5545. For an alarm whose action is "DISPLAY", the mandatory DESCRIPTION property is created by choosing the first non-null value from this instance's summary field, this instance's description field, the enclosing component's summary field, and finally the enclosing component's description field in that order. For an email alarm, both the summary and the description are required. If any of these is null, the corresponding fields in the enclosing iCalendar component will be used instead.Parameters defined by RFC 5545 for a comment are LANGUAGE and ALTREP.
- Parameters:
summary
- a summary describing this event; null if there is no summaryparameters
- the parameters for this property
-
setDescription
Set the description for this alarm. The use of this method is optional: defaults will be provided if this method is not used, provided that a summary was provided in the enclosing component. The mandatory argument is a string describing the alarm in more detail than what would appear in a summary. Section 3.8.1.5 of RFC 5545.Parameters defined by RFC 5545 for a comment are LANGUAGE and ALTREP.
- Parameters:
description
- a full describing this event; null if there is no descriptionparameters
- the parameters for this property
-
repeat
Set the repeat count and the corresponding duration. The first argument refers to the REPEAT property specified in Section 3.8.6.2 of RFC 5545, and the second argument refers to the DURATION property specified in Section 3.8.2.5 of RFC 5545.- Parameters:
repeat
- the repetition countduration
- the duration in minutes- Throws:
IllegalArgumentException
-
createContentLines
protected void createContentLines()Description copied from class:ICalBuilder.Base
Generate content lines. Subclasses that override this method should callsuper.createContentLines()
.- Overrides:
createContentLines
in classICalBuilder.Base
-