biweekly.component
Class VTimezone

java.lang.Object
  extended by biweekly.component.ICalComponent
      extended by biweekly.component.VTimezone

public class VTimezone
extends ICalComponent

Defines a timezone's UTC offsets throughout the year.

Examples:

 VTimezone timezone = new VTimezone("Eastern Standard Time");
 
 StandardTime standard = new StandardTime();
 DateTimeComponents componentsStandard = new DateTimeComponents(1998, 10, 25, 2, 0, 0, false);
 standard.setDateStart(componentsStandard);
 standard.setTimezoneOffsetFrom(-4, 0);
 standard.setTimezoneOffsetTo(-5, 0);
 timezone.addStandardTime(standard);
 
 DaylightSavingsTime daylight = new DaylightSavingsTime();
 DateTimeComponents componentsDaylight = new DateTimeComponents(1999, 4, 4, 2, 0, 0, false);
 daylight.setDateStart(componentsDaylight);
 daylight.setTimezoneOffsetFrom(-5, 0);
 daylight.setTimezoneOffsetTo(-4, 0);
 timezone.addDaylightSavingsTime(daylight);
 

Author:
Michael Angstadt
Specification Reference:
RFC 5545 p.62-71

Field Summary
 
Fields inherited from class biweekly.component.ICalComponent
components, properties
 
Constructor Summary
VTimezone(String identifier)
          Creates a new timezone component.
 
Method Summary
 void addDaylightSavingsTime(DaylightSavingsTime daylightSavingsTime)
          Adds a "daylight savings" observance time range.
 void addStandardTime(StandardTime standardTime)
          Adds a "standard" observance time range.
 List<DaylightSavingsTime> getDaylightSavingsTime()
          Gets the timezone's "daylight savings" observance time ranges.
 LastModified getLastModified()
          Gets the date-time that the timezone data was last changed.
 List<StandardTime> getStandardTimes()
          Gets the timezone's "standard" observance time ranges.
 TimezoneId getTimezoneId()
          Gets the ID for this timezone.
 TimezoneUrl getTimezoneUrl()
          Gets the timezone URL, which points to an iCalendar object that contains further information on the timezone.
 LastModified setLastModified(Date lastModified)
          Sets the date-time that the timezone data was last changed.
 void setLastModified(LastModified lastModified)
          Sets the date-time that the timezone data was last changed.
 TimezoneId setTimezoneId(String timezoneId)
          Sets an ID for this timezone.
 void setTimezoneId(TimezoneId timezoneId)
          Sets an ID for this timezone.
 TimezoneUrl setTimezoneUrl(String url)
          Sets the timezone URL, which points to an iCalendar object that contains further information on the timezone.
 void setTimezoneUrl(TimezoneUrl url)
          Sets the timezone URL, which points to an iCalendar object that contains further information on the timezone.
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

VTimezone

public VTimezone(String identifier)
Creates a new timezone component.

Parameters:
identifier - a unique identifier for this timezone (allows it to be referenced by date-time properties that support timezones).
Method Detail

getTimezoneId

public TimezoneId getTimezoneId()
Gets the ID for this timezone. This is a required property.

Returns:
the timezone ID or null if not set
Specification Reference:
RFC 5545 p.102-3

setTimezoneId

public void setTimezoneId(TimezoneId timezoneId)
Sets an ID for this timezone. This is a required property.

Parameters:
timezoneId - the timezone ID or null to remove
Specification Reference:
RFC 5545 p.102-3

setTimezoneId

public TimezoneId setTimezoneId(String timezoneId)
Sets an ID for this timezone. This is a required property.

Parameters:
timezoneId - the timezone ID or null to remove
Returns:
the property that was created
Specification Reference:
RFC 5545 p.102-3

getLastModified

public LastModified getLastModified()
Gets the date-time that the timezone data was last changed.

Returns:
the last modified date or null if not set
Specification Reference:
RFC 5545 p.138

setLastModified

public void setLastModified(LastModified lastModified)
Sets the date-time that the timezone data was last changed.

Parameters:
lastModified - the last modified date or null to remove
Specification Reference:
RFC 5545 p.138

setLastModified

public LastModified setLastModified(Date lastModified)
Sets the date-time that the timezone data was last changed.

Parameters:
lastModified - the last modified date or null to remove
Returns:
the property that was created
Specification Reference:
RFC 5545 p.138

getTimezoneUrl

public TimezoneUrl getTimezoneUrl()
Gets the timezone URL, which points to an iCalendar object that contains further information on the timezone.

Returns:
the URL or null if not set
Specification Reference:
RFC 5545 p.106

setTimezoneUrl

public void setTimezoneUrl(TimezoneUrl url)
Sets the timezone URL, which points to an iCalendar object that contains further information on the timezone.

Parameters:
url - the URL or null to remove
Specification Reference:
RFC 5545 p.106

setTimezoneUrl

public TimezoneUrl setTimezoneUrl(String url)
Sets the timezone URL, which points to an iCalendar object that contains further information on the timezone.

Parameters:
url - the timezone URL (e.g. "http://example.com/America-New_York.ics") or null to remove
Returns:
the property that was created
Specification Reference:
RFC 5545 p.106

getStandardTimes

public List<StandardTime> getStandardTimes()
Gets the timezone's "standard" observance time ranges.

Returns:
the "standard" observance time ranges

addStandardTime

public void addStandardTime(StandardTime standardTime)
Adds a "standard" observance time range.

Parameters:
standardTime - the "standard" observance time

getDaylightSavingsTime

public List<DaylightSavingsTime> getDaylightSavingsTime()
Gets the timezone's "daylight savings" observance time ranges.

Returns:
the "daylight savings" observance time ranges

addDaylightSavingsTime

public void addDaylightSavingsTime(DaylightSavingsTime daylightSavingsTime)
Adds a "daylight savings" observance time range.

Parameters:
daylightSavingsTime - the "daylight savings" observance time

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.