biweekly.property
Class Trigger

java.lang.Object
  extended by biweekly.property.ICalProperty
      extended by biweekly.property.Trigger

public class Trigger
extends ICalProperty

Defines when an alarm will be triggered.

Examples:

 //15 minutes before the start time
 Duration duration = Duration.builder().prior(true).minutes(15).build();
 Trigger trigger = new Trigger(duration, Related.START);
 VAlarm alarm = VAlarm.display(trigger, "Meeting in 15 minutes");
 

Author:
Michael Angstadt
Specification Reference:
RFC 5545 p.133-6

Field Summary
 
Fields inherited from class biweekly.property.ICalProperty
parameters
 
Constructor Summary
Trigger(Date date)
          Creates a trigger property.
Trigger(Duration duration, Related related)
          Creates a trigger property.
 
Method Summary
 Date getDate()
          Gets the date-time that the alarm will trigger.
 Duration getDuration()
          Gets the relative time at which the alarm will trigger.
 Related getRelated()
          Gets the date-time field that the duration is relative to.
 void setDate(Date date)
          Sets the date-time that the alarm will trigger.
 void setDuration(Duration duration, Related related)
          Sets a relative time at which the alarm will trigger.
 void setRelated(Related related)
          Sets the date-time field that the duration is relative to.
protected  void validate(List<ICalComponent> components, List<String> warnings)
          Checks the property for data consistency problems or deviations from the spec.
 
Methods inherited from class biweekly.property.ICalProperty
addParameter, getParameter, getParameters, getParameters, removeParameter, setParameter, setParameter, setParameters, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Trigger

public Trigger(Duration duration,
               Related related)
Creates a trigger property.

Parameters:
duration - the relative time
related - the date-time field that the duration is relative to

Trigger

public Trigger(Date date)
Creates a trigger property.

Parameters:
date - the date-time the alarm will trigger.
Method Detail

getDuration

public Duration getDuration()
Gets the relative time at which the alarm will trigger.

Returns:
the relative time or null if an absolute time is set

setDuration

public void setDuration(Duration duration,
                        Related related)
Sets a relative time at which the alarm will trigger.

Parameters:
duration - the relative time
related - the date-time field that the duration is relative to

getDate

public Date getDate()
Gets the date-time that the alarm will trigger.

Returns:
the date-time or null if a relative duration is set

setDate

public void setDate(Date date)
Sets the date-time that the alarm will trigger.

Parameters:
date - the date-time the alarm will trigger.

getRelated

public Related getRelated()
Gets the date-time field that the duration is relative to.

Returns:
the field or null if not set
Specification Reference:
RFC 5545 p.24

setRelated

public void setRelated(Related related)
Sets the date-time field that the duration is relative to.

Parameters:
related - the field or null to remove
Specification Reference:
RFC 5545 p.24

validate

protected void validate(List<ICalComponent> components,
                        List<String> warnings)
Description copied from class: ICalProperty
Checks the property for data consistency problems or deviations from the spec. Meant to be overridden by child classes that wish to provide validation logic.

Overrides:
validate in class ICalProperty
Parameters:
components - the hierarchy of components that the property belongs to
warnings - the list to add the warnings to


Copyright © 2013 Michael Angstadt. All Rights Reserved.