biweekly.component
Class Observance

java.lang.Object
  extended by biweekly.component.ICalComponent
      extended by biweekly.component.Observance
Direct Known Subclasses:
DaylightSavingsTime, StandardTime

public abstract class Observance
extends ICalComponent

Parent class for the "daylight" and "standard" timezone observances.

Author:
Michael Angstadt
See Also:
DaylightSavingsTime, StandardTime
Specification Reference:
RFC 5545 p.62-71

Field Summary
 
Fields inherited from class biweekly.component.ICalComponent
components, properties
 
Constructor Summary
Observance()
           
 
Method Summary
 void addComment(Comment comment)
          Adds a comment to the timezone observance.
 Comment addComment(String comment)
          Adds a comment to the timezone observance.
 void addExceptionDates(ExceptionDates exceptionDates)
          Adds a list of exceptions to the timezone observance.
 void addRecurrenceDates(RecurrenceDates recurrenceDates)
          Adds a list of dates/periods that help define the recurrence rule of this timezone observance (if one is defined).
 TimezoneName addTimezoneName(String timezoneName)
          Adds a traditional, non-standard name for the timezone observance.
 void addTimezoneName(TimezoneName timezoneName)
          Adds a traditional, non-standard name for the timezone observance.
 List<Comment> getComments()
          Gets the comments attached to the timezone observance.
 DateStart getDateStart()
          Gets the date that the timezone observance starts.
 List<ExceptionDates> getExceptionDates()
          Gets the list of exceptions to the timezone observance.
 List<RecurrenceDates> getRecurrenceDates()
          Gets the list of dates/periods that help define the recurrence rule of this timezone observance (if one is defined).
 RecurrenceRule getRecurrenceRule()
          Gets how often the timezone observance repeats.
 List<TimezoneName> getTimezoneNames()
          Gets the traditional, non-standard names for the timezone observance.
 TimezoneOffsetFrom getTimezoneOffsetFrom()
          Gets the UTC offset that the timezone observance transitions from.
 TimezoneOffsetTo getTimezoneOffsetTo()
          Gets the UTC offset that the timezone observance transitions to.
 void setDateStart(DateStart dateStart)
          Sets the date that the timezone observance starts.
 DateStart setDateStart(DateTimeComponents components)
          Sets the date that the timezone observance starts.
 RecurrenceRule setRecurrenceRule(Recurrence recur)
          Sets how often the timezone observance repeats.
 void setRecurrenceRule(RecurrenceRule recurrenceRule)
          Sets how often the timezone observance repeats.
 TimezoneOffsetFrom setTimezoneOffsetFrom(Integer hour, Integer minute)
          Sets the UTC offset that the timezone observance transitions from.
 void setTimezoneOffsetFrom(TimezoneOffsetFrom timezoneOffsetFrom)
          Sets the UTC offset that the timezone observance transitions from.
 TimezoneOffsetTo setTimezoneOffsetTo(Integer hour, Integer minute)
          Sets the UTC offset that the timezone observance transitions to.
 void setTimezoneOffsetTo(TimezoneOffsetTo timezoneOffsetTo)
          Sets the UTC offset that the timezone observance transitions to.
protected  void validate(List<ICalComponent> components, List<String> warnings)
          Checks the component for data consistency problems or deviations from the spec.
 
Methods inherited from class biweekly.component.ICalComponent
addComponent, addExperimentalComponent, addExperimentalProperty, addExperimentalProperty, addProperty, checkOptionalCardinality, checkRequiredCardinality, getComponent, getComponents, getComponents, getExperimentalComponent, getExperimentalComponents, getExperimentalComponents, getExperimentalProperties, getExperimentalProperties, getExperimentalProperty, getProperties, getProperties, getProperty, removeExperimentalComponents, removeExperimentalProperty, removeProperties, setComponent, setComponent, setExperimentalComponents, setExperimentalProperty, setExperimentalProperty, setProperty, setProperty, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Observance

public Observance()
Method Detail

getDateStart

public DateStart getDateStart()
Gets the date that the timezone observance starts.

Returns:
the start date or null if not set
Specification Reference:
RFC 5545 p.97-8

setDateStart

public void setDateStart(DateStart dateStart)
Sets the date that the timezone observance starts.

Parameters:
dateStart - the start date or null to remove
Specification Reference:
RFC 5545 p.97-8

setDateStart

public DateStart setDateStart(DateTimeComponents components)
Sets the date that the timezone observance starts.

Parameters:
components - the raw components of the start date or null to remove
Returns:
the property that was created
Specification Reference:
RFC 5545 p.97-8

getTimezoneOffsetTo

public TimezoneOffsetTo getTimezoneOffsetTo()
Gets the UTC offset that the timezone observance transitions to.

Returns:
the UTC offset or null if not set
Specification Reference:
RFC 5545 p.105-6

setTimezoneOffsetTo

public void setTimezoneOffsetTo(TimezoneOffsetTo timezoneOffsetTo)
Sets the UTC offset that the timezone observance transitions to.

Parameters:
timezoneOffsetTo - the UTC offset or null to remove
Specification Reference:
RFC 5545 p.105-6

setTimezoneOffsetTo

public TimezoneOffsetTo setTimezoneOffsetTo(Integer hour,
                                            Integer minute)
Sets the UTC offset that the timezone observance transitions to.

Parameters:
hour - the hour offset (e.g. "-5")
minute - the minute offset (e.g. "0")
Returns:
the property that was created
Specification Reference:
RFC 5545 p.105-6

getTimezoneOffsetFrom

public TimezoneOffsetFrom getTimezoneOffsetFrom()
Gets the UTC offset that the timezone observance transitions from.

Returns:
the UTC offset or null if not set
Specification Reference:
RFC 5545 p.104-5

setTimezoneOffsetFrom

public void setTimezoneOffsetFrom(TimezoneOffsetFrom timezoneOffsetFrom)
Sets the UTC offset that the timezone observance transitions from.

Parameters:
timezoneOffsetFrom - the UTC offset or null to remove
Specification Reference:
RFC 5545 p.104-5

setTimezoneOffsetFrom

public TimezoneOffsetFrom setTimezoneOffsetFrom(Integer hour,
                                                Integer minute)
Sets the UTC offset that the timezone observance transitions from.

Parameters:
hour - the hour offset (e.g. "-5")
minute - the minute offset (e.g. "0")
Returns:
the property that was created
Specification Reference:
RFC 5545 p.104-5

getRecurrenceRule

public RecurrenceRule getRecurrenceRule()
Gets how often the timezone observance repeats.

Returns:
the recurrence rule or null if not set
Specification Reference:
RFC 5545 p.122-32

setRecurrenceRule

public RecurrenceRule setRecurrenceRule(Recurrence recur)
Sets how often the timezone observance repeats.

Parameters:
recur - the recurrence rule or null to remove
Returns:
the property that was created
Specification Reference:
RFC 5545 p.122-32

setRecurrenceRule

public void setRecurrenceRule(RecurrenceRule recurrenceRule)
Sets how often the timezone observance repeats.

Parameters:
recurrenceRule - the recurrence rule or null to remove
Specification Reference:
RFC 5545 p.122-32

getComments

public List<Comment> getComments()
Gets the comments attached to the timezone observance.

Returns:
the comments
Specification Reference:
RFC 5545 p.83-4

addComment

public void addComment(Comment comment)
Adds a comment to the timezone observance.

Parameters:
comment - the comment to add
Specification Reference:
RFC 5545 p.83-4

addComment

public Comment addComment(String comment)
Adds a comment to the timezone observance.

Parameters:
comment - the comment to add
Returns:
the property that was created
Specification Reference:
RFC 5545 p.83-4

getRecurrenceDates

public List<RecurrenceDates> getRecurrenceDates()
Gets the list of dates/periods that help define the recurrence rule of this timezone observance (if one is defined).

Returns:
the recurrence dates
Specification Reference:
RFC 5545 p.120-2

addRecurrenceDates

public void addRecurrenceDates(RecurrenceDates recurrenceDates)
Adds a list of dates/periods that help define the recurrence rule of this timezone observance (if one is defined).

Parameters:
recurrenceDates - the recurrence dates
Specification Reference:
RFC 5545 p.120-2

getTimezoneNames

public List<TimezoneName> getTimezoneNames()
Gets the traditional, non-standard names for the timezone observance.

Returns:
the timezone observance names
Specification Reference:
RFC 5545 p.103-4

addTimezoneName

public void addTimezoneName(TimezoneName timezoneName)
Adds a traditional, non-standard name for the timezone observance.

Parameters:
timezoneName - the timezone observance name
Specification Reference:
RFC 5545 p.103-4

addTimezoneName

public TimezoneName addTimezoneName(String timezoneName)
Adds a traditional, non-standard name for the timezone observance.

Parameters:
timezoneName - the timezone observance name (e.g. "EST")
Returns:
the property that was created
Specification Reference:
RFC 5545 p.103-4

getExceptionDates

public List<ExceptionDates> getExceptionDates()
Gets the list of exceptions to the timezone observance.

Returns:
the list of exceptions
Specification Reference:
RFC 5545 p.118-20

addExceptionDates

public void addExceptionDates(ExceptionDates exceptionDates)
Adds a list of exceptions to the timezone observance. Note that this property can contain multiple dates.

Parameters:
exceptionDates - the list of exceptions
Specification Reference:
RFC 5545 p.118-20

validate

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

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


Copyright © 2013 Michael Angstadt. All Rights Reserved.