net.fortuna.ical4j.model.component
Class VTimeZone

java.lang.Object
  extended by net.fortuna.ical4j.model.Component
      extended by net.fortuna.ical4j.model.component.CalendarComponent
          extended by net.fortuna.ical4j.model.component.VTimeZone
All Implemented Interfaces:
java.io.Serializable

public class VTimeZone
extends CalendarComponent

$Id: VTimeZone.java,v 1.27 2009/01/08 14:18:32 fortuna Exp $ [Apr 5, 2004] Defines an iCalendar VTIMEZONE component.

       4.6.5 Time Zone Component
  
          Component Name: VTIMEZONE
  
          Purpose: Provide a grouping of component properties that defines a
          time zone.
  
          Formal Definition: A "VTIMEZONE" calendar component is defined by the
          following notation:
  
            timezonec  = "BEGIN" ":" "VTIMEZONE" CRLF
  
                         2*(
  
                         ; 'tzid' is required, but MUST NOT occur more
                         ; than once
  
                       tzid /
  
                         ; 'last-mod' and 'tzurl' are optional,
                       but MUST NOT occur more than once
  
                       last-mod / tzurl /
  
                         ; one of 'standardc' or 'daylightc' MUST occur
                       ..; and each MAY occur more than once.
  
                       standardc / daylightc /
  
                       ; the following is optional,
                       ; and MAY occur more than once
  
                         x-prop
  
                         )
  
                         "END" ":" "VTIMEZONE" CRLF
  
            standardc  = "BEGIN" ":" "STANDARD" CRLF
  
                         tzprop
  
                         "END" ":" "STANDARD" CRLF
  
            daylightc  = "BEGIN" ":" "DAYLIGHT" CRLF
  
                         tzprop
  
                         "END" ":" "DAYLIGHT" CRLF
  
            tzprop     = 3*(
  
                       ; the following are each REQUIRED,
                       ; but MUST NOT occur more than once
  
                       dtstart / tzoffsetto / tzoffsetfrom /
  
                       ; the following are optional,
                       ; and MAY occur more than once
  
                       comment / rdate / rrule / tzname / x-prop
  
                       )
 

Author:
Ben Fortuna
See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.fortuna.ical4j.model.Component
AVAILABLE, BEGIN, END, EXPERIMENTAL_PREFIX, VALARM, VAVAILABILITY, VEVENT, VFREEBUSY, VJOURNAL, VTIMEZONE, VTODO, VVENUE
 
Constructor Summary
VTimeZone()
          Default constructor.
VTimeZone(ComponentList observances)
          Constructs a new vtimezone component with no properties and the specified list of type components.
VTimeZone(PropertyList properties)
          Constructs a new instance containing the specified properties.
VTimeZone(PropertyList properties, ComponentList observances)
          Constructor.
 
Method Summary
 Component copy()
          Overrides default copy method to add support for copying observance sub-components.
 boolean equals(java.lang.Object arg0)
          Uses EqualsBuilder to test equality.
 Observance getApplicableObservance(Date date)
          Returns the latest applicable timezone observance for the specified date.
 LastModified getLastModified()
           
 ComponentList getObservances()
           
 TzId getTimeZoneId()
           
 TzUrl getTimeZoneUrl()
           
 int hashCode()
          Uses HashCodeBuilder to build hashcode.
 java.lang.String toString()
           
 void validate(boolean recurse)
          Perform validation on a component.
 void validateAdd()
          Apply validation for METHOD=ADD.
 void validateCancel()
          Apply validation for METHOD=CANCEL.
 void validateCounter()
          Apply validation for METHOD=COUNTER.
 void validateDeclineCounter()
          Apply validation for METHOD=DECLINE-COUNTER.
 void validatePublish()
          Apply validation for METHOD=PUBLISH.
 void validateRefresh()
          Apply validation for METHOD=REFRESH.
 void validateReply()
          Apply validation for METHOD=REPLY.
 void validateRequest()
          Apply validation for METHOD=REQUEST.
 
Methods inherited from class net.fortuna.ical4j.model.Component
calculateRecurrenceSet, getName, getProperties, getProperties, getProperty, validate, validateProperties
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VTimeZone

public VTimeZone()
Default constructor.


VTimeZone

public VTimeZone(PropertyList properties)
Constructs a new instance containing the specified properties.

Parameters:
properties - a list of properties

VTimeZone

public VTimeZone(ComponentList observances)
Constructs a new vtimezone component with no properties and the specified list of type components.

Parameters:
observances - a list of type components

VTimeZone

public VTimeZone(PropertyList properties,
                 ComponentList observances)
Constructor.

Parameters:
properties - a list of properties
observances - a list of timezone types
Method Detail

toString

public final java.lang.String toString()
Overrides:
toString in class Component
See Also:
Object.toString()

validate

public final void validate(boolean recurse)
                    throws ValidationException
Description copied from class: Component
Perform validation on a component.

Specified by:
validate in class Component
Parameters:
recurse - indicates whether to validate the component's properties
Throws:
ValidationException - where the component is not in a valid state

validatePublish

public void validatePublish()
                     throws ValidationException
Description copied from class: CalendarComponent
Apply validation for METHOD=PUBLISH.

Specified by:
validatePublish in class CalendarComponent
Throws:
ValidationException

validateAdd

public void validateAdd()
                 throws ValidationException
Description copied from class: CalendarComponent
Apply validation for METHOD=ADD.

Specified by:
validateAdd in class CalendarComponent
Throws:
ValidationException

validateCancel

public void validateCancel()
                    throws ValidationException
Description copied from class: CalendarComponent
Apply validation for METHOD=CANCEL.

Specified by:
validateCancel in class CalendarComponent
Throws:
ValidationException

validateCounter

public void validateCounter()
                     throws ValidationException
Description copied from class: CalendarComponent
Apply validation for METHOD=COUNTER.

Specified by:
validateCounter in class CalendarComponent
Throws:
ValidationException

validateDeclineCounter

public void validateDeclineCounter()
                            throws ValidationException
Description copied from class: CalendarComponent
Apply validation for METHOD=DECLINE-COUNTER.

Specified by:
validateDeclineCounter in class CalendarComponent
Throws:
ValidationException

validateRefresh

public void validateRefresh()
                     throws ValidationException
Description copied from class: CalendarComponent
Apply validation for METHOD=REFRESH.

Specified by:
validateRefresh in class CalendarComponent
Throws:
ValidationException

validateReply

public void validateReply()
                   throws ValidationException
Description copied from class: CalendarComponent
Apply validation for METHOD=REPLY.

Specified by:
validateReply in class CalendarComponent
Throws:
ValidationException

validateRequest

public void validateRequest()
                     throws ValidationException
Description copied from class: CalendarComponent
Apply validation for METHOD=REQUEST.

Specified by:
validateRequest in class CalendarComponent
Throws:
ValidationException

getObservances

public final ComponentList getObservances()
Returns:
Returns the types.

getApplicableObservance

public final Observance getApplicableObservance(Date date)
Returns the latest applicable timezone observance for the specified date.

Parameters:
date - the latest possible date for a timezone observance onset
Returns:
the latest applicable timezone observance for the specified date or null if there are no applicable observances

getTimeZoneId

public final TzId getTimeZoneId()
Returns:
the mandatory timezone identifier property

getLastModified

public final LastModified getLastModified()
Returns:
the optional last-modified property

getTimeZoneUrl

public final TzUrl getTimeZoneUrl()
Returns:
the optional timezone url property

equals

public boolean equals(java.lang.Object arg0)
Description copied from class: Component
Uses EqualsBuilder to test equality. Two components are equal if and only if their name and property lists are equal.

Overrides:
equals in class Component

hashCode

public int hashCode()
Description copied from class: Component
Uses HashCodeBuilder to build hashcode.

Overrides:
hashCode in class Component

copy

public Component copy()
               throws java.text.ParseException,
                      java.io.IOException,
                      java.net.URISyntaxException
Overrides default copy method to add support for copying observance sub-components.

Overrides:
copy in class Component
Returns:
the component copy
Throws:
java.text.ParseException
java.io.IOException
java.net.URISyntaxException
See Also:
Component.copy()


Copyright © 2004-2009 Modularity. All Rights Reserved.