Class VTimeZone
- java.lang.Object
-
- net.fortuna.ical4j.model.Content
-
- net.fortuna.ical4j.model.Component
-
- net.fortuna.ical4j.model.component.CalendarComponent
-
- net.fortuna.ical4j.model.component.VTimeZone
-
- All Implemented Interfaces:
Serializable
,ComponentContainer<Observance>
,FluentComponent
,PropertyContainer
public class VTimeZone extends CalendarComponent implements ComponentContainer<Observance>
$Id$ [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 )
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VTimeZone.Factory
-
Field Summary
-
Fields inherited from class net.fortuna.ical4j.model.component.CalendarComponent
EMPTY_VALIDATOR
-
Fields inherited from class net.fortuna.ical4j.model.Component
AVAILABLE, BEGIN, components, END, EXPERIMENTAL_PREFIX, PARTICIPANT, properties, VALARM, VAVAILABILITY, VEVENT, VFREEBUSY, VJOURNAL, VLOCATION, VRESOURCE, VTIMEZONE, VTODO, VVENUE
-
-
Constructor Summary
Constructors Constructor Description VTimeZone()
Default constructor.VTimeZone(ComponentList<Observance> 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<Observance> observances)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
equals(Object arg0)
Observance
getApplicableObservance(Temporal date)
Returns the latest applicable timezone observance for the specified date.static Observance
getApplicableObservance(Temporal date, List<Observance> observances)
Returns the latest applicable timezone observance for the specified date.ComponentList<Observance>
getComponentList()
Optional<LastModified>
getLastModified()
Deprecated.List<Observance>
getObservances()
Optional<TzId>
getTimeZoneId()
Deprecated.Optional<TzUrl>
getTimeZoneUrl()
Deprecated.int
hashCode()
protected ComponentFactory<VTimeZone>
newFactory()
Returns a new component factory used to create deep copies.void
setComponentList(ComponentList<Observance> components)
ValidationResult
validate(boolean recurse)
Perform validation on a component.ValidationResult
validate(Method method)
Performs method-specific ITIP validation.-
Methods inherited from class net.fortuna.ical4j.model.component.CalendarComponent
validateAdd, validateCancel, validateCounter, validateDeclineCounter, validatePublish, validateRefresh, validateReply, validateRequest
-
Methods inherited from class net.fortuna.ical4j.model.Component
calculateRecurrenceSet, copy, getFluentTarget, getName, getProperties, getPropertyList, getValue, setPropertyList, toString, validate, validateProperties
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.fortuna.ical4j.model.ComponentContainer
add, getComponent, getComponents, remove, replace
-
Methods inherited from interface net.fortuna.ical4j.model.FluentComponent
withProperty
-
Methods inherited from interface net.fortuna.ical4j.model.PropertyContainer
add, addAll, getProperties, getProperty, getRequiredProperty, remove, removeAll, replace
-
-
-
-
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<Observance> 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<Observance> observances)
Constructor.- Parameters:
properties
- a list of propertiesobservances
- a list of timezone types
-
-
Method Detail
-
validate
public ValidationResult validate(boolean recurse) throws ValidationException
Perform validation on a component.- Specified by:
validate
in classComponent
- Parameters:
recurse
- indicates whether to validate the component's properties- Throws:
ValidationException
- where the component is not in a valid state
-
validate
public ValidationResult validate(Method method) throws ValidationException
Description copied from class:CalendarComponent
Performs method-specific ITIP validation.- Overrides:
validate
in classCalendarComponent
- Parameters:
method
- the applicable method- Throws:
ValidationException
- where the component does not comply with RFC2446
-
getObservances
public final List<Observance> getObservances()
- Returns:
- Returns the types.
-
getComponentList
public ComponentList<Observance> getComponentList()
- Specified by:
getComponentList
in interfaceComponentContainer<Observance>
- Returns:
- Returns the underlying component list.
-
setComponentList
public void setComponentList(ComponentList<Observance> components)
- Specified by:
setComponentList
in interfaceComponentContainer<Observance>
-
getApplicableObservance
public final Observance getApplicableObservance(Temporal 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
-
getApplicableObservance
public static Observance getApplicableObservance(Temporal date, List<Observance> observances)
Returns the latest applicable timezone observance for the specified date.- Parameters:
date
- the latest possible date for a timezone observance onsetobservances
- a list of observances to choose from- Returns:
- the latest applicable timezone observance for the specified date or null if there are no applicable observances
-
getTimeZoneId
@Deprecated public final Optional<TzId> getTimeZoneId()
Deprecated.- Returns:
- the mandatory timezone identifier property
-
getLastModified
@Deprecated public final Optional<LastModified> getLastModified()
Deprecated.- Returns:
- the optional last-modified property
-
getTimeZoneUrl
@Deprecated public final Optional<TzUrl> getTimeZoneUrl()
Deprecated.- Returns:
- the optional timezone url property
-
newFactory
protected ComponentFactory<VTimeZone> newFactory()
Description copied from class:Component
Returns a new component factory used to create deep copies.- Specified by:
newFactory
in classComponent
- Returns:
- a component factory instance
-
-