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, 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.
 Comment addComment(String comment)
          Adds a comment to the timezone.
 void addExceptionDates(ExceptionDates exceptionDates)
          Adds a list of exceptions to the observance.
 void addRecurrenceDates(RecurrenceDates recurrenceDates)
          Adds a list of dates/periods that help define the recurrence rule of this observance (if one is defined).
 TimezoneName addTimezoneName(String timezoneName)
          Adds a traditional, non-standard name for the timezone.
 void addTimezoneName(TimezoneName timezoneName)
          Adds a traditional, non-standard name for the timezone.
 List<Comment> getComments()
          Gets the comments attached to the timezone.
 DateStart getDateStart()
          Gets the date that the timezone starts.
 List<ExceptionDates> getExceptionDates()
          Gets the list of exceptions to the observance.
 List<RecurrenceDates> getRecurrenceDates()
          Gets the list of dates/periods that help define the recurrence rule of this observance (if one is defined).
 RecurrenceRule getRecurrenceRule()
          Gets how often the observance repeats.
 List<TimezoneName> getTimezoneNames()
          Gets the traditional, non-standard names for the timezone.
 TimezoneOffsetFrom getTimezoneOffsetFrom()
          Gets the timezone offset that was in use before the timezone observance.
 TimezoneOffsetTo getTimezoneOffsetTo()
          Gets the timezone offset that is currently in use in the timezone observance.
 DateStart setDateStart(Date dateStart)
          Sets the date that the timezone starts.
 void setDateStart(DateStart dateStart)
          Sets the date that the timezone starts.
 void setRecurrenceRule(RecurrenceRule recurrenceRule)
          Sets how often the observance repeats.
 TimezoneOffsetFrom setTimezoneOffsetFrom(Integer hour, Integer minute)
          Sets the timezone offset that was in use before the timezone observance.
 void setTimezoneOffsetFrom(TimezoneOffsetFrom timezoneOffsetFrom)
          Sets the timezone offset that was in use before the timezone observance.
 TimezoneOffsetTo setTimezoneOffsetTo(Integer hour, Integer minute)
          Sets the timezone offset that is currently in use in the timezone observance.
 void setTimezoneOffsetTo(TimezoneOffsetTo timezoneOffsetTo)
          Sets the timezone offset that is currently in use in the timezone observance.
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, addProperty, checkOptionalCardinality, checkRequiredCardinality, getComponent, getComponents, getComponents, getExperimentalComponent, getExperimentalComponents, getExperimentalComponents, getExperimentalProperties, getExperimentalProperties, getExperimentalProperty, getProperties, getProperties, getProperty, removeExperimentalComponents, removeExperimentalProperty, removeProperties, setComponent, setComponent, setExperimentalComponents, 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 starts.

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

setDateStart

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

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

setDateStart

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

Parameters:
dateStart - the start date or null to remove
Returns:
the property that was created
See Also:
RFC 5545 p.97-8

getTimezoneOffsetTo

public TimezoneOffsetTo getTimezoneOffsetTo()
Gets the timezone offset that is currently in use in the timezone observance.

Returns:
the timezone offset or null if not set
See Also:
RFC 5545 p.105-6

setTimezoneOffsetTo

public void setTimezoneOffsetTo(TimezoneOffsetTo timezoneOffsetTo)
Sets the timezone offset that is currently in use in the timezone observance.

Parameters:
timezoneOffsetTo - the timezone offset or null to remove
See Also:
RFC 5545 p.105-6

setTimezoneOffsetTo

public TimezoneOffsetTo setTimezoneOffsetTo(Integer hour,
                                            Integer minute)
Sets the timezone offset that is currently in use in the timezone observance.

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

getTimezoneOffsetFrom

public TimezoneOffsetFrom getTimezoneOffsetFrom()
Gets the timezone offset that was in use before the timezone observance.

Returns:
the timezone offset or null if not set
See Also:
RFC 5545 p.104-5

setTimezoneOffsetFrom

public void setTimezoneOffsetFrom(TimezoneOffsetFrom timezoneOffsetFrom)
Sets the timezone offset that was in use before the timezone observance.

Parameters:
timezoneOffsetFrom - the timezone offset or null to remove
See Also:
RFC 5545 p.104-5

setTimezoneOffsetFrom

public TimezoneOffsetFrom setTimezoneOffsetFrom(Integer hour,
                                                Integer minute)
Sets the timezone offset that was in use before the timezone observance.

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

getRecurrenceRule

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

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

setRecurrenceRule

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

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

getComments

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

Returns:
the comments
See Also:
RFC 5545 p.83-4

addComment

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

Parameters:
comment - the comment to add
See Also:
RFC 5545 p.83-4

addComment

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

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

getRecurrenceDates

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

Returns:
the recurrence dates
See Also:
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 observance (if one is defined).

Parameters:
recurrenceDates - the recurrence dates
See Also:
RFC 5545 p.120-2

getTimezoneNames

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

Returns:
the timezone names
See Also:
RFC 5545 p.103-4

addTimezoneName

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

Parameters:
timezoneName - the timezone name
See Also:
RFC 5545 p.103-4

addTimezoneName

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

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

getExceptionDates

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

Returns:
the list of exceptions
See Also:
RFC 5545 p.118-20

addExceptionDates

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

Parameters:
exceptionDates - the list of exceptions
See Also:
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.