Class Observance
- java.lang.Object
-
- net.fortuna.ical4j.model.Component
-
- net.fortuna.ical4j.model.component.Observance
-
- All Implemented Interfaces:
Serializable,PropertyContainer
public abstract class Observance extends Component
$Id$ [05-Apr-2004] Defines an iCalendar sub-component representing a timezone observance. Class made abstract such that only Standard and Daylight instances are valid.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringDAYLIGHTToken for daylight observance.static StringSTANDARDone of 'standardc' or 'daylightc' MUST occur and each MAY occur more than once.-
Fields inherited from class net.fortuna.ical4j.model.Component
AVAILABLE, BEGIN, components, END, EXPERIMENTAL_PREFIX, PARTICIPANT, VALARM, VAVAILABILITY, VEVENT, VFREEBUSY, VJOURNAL, VLOCATION, VRESOURCE, VTIMEZONE, VTODO, VVENUE
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedObservance(String name)Constructs a timezone observance with the specified name and no properties.protectedObservance(String name, PropertyList<Property> properties)Constructor protected to enforce use of sub-classes from this library.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DategetLatestOnset(Date date)Returns the latest applicable onset of this observance for the specified date.TzOffsetFromgetOffsetFrom()Returns the mandatory tzoffsetfrom property.TzOffsetTogetOffsetTo()Returns the mandatory tzoffsetto property.DtStartgetStartDate()Returns the mandatory dtstart property.voidvalidate(boolean recurse)Perform validation on a component.-
Methods inherited from class net.fortuna.ical4j.model.Component
calculateRecurrenceSet, copy, equals, getName, getProperties, getRequiredProperty, hashCode, 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.PropertyContainer
getProperties, getProperty
-
-
-
-
Field Detail
-
STANDARD
public static final String STANDARD
one of 'standardc' or 'daylightc' MUST occur and each MAY occur more than once.- See Also:
- Constant Field Values
-
DAYLIGHT
public static final String DAYLIGHT
Token for daylight observance.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Observance
protected Observance(String name)
Constructs a timezone observance with the specified name and no properties.- Parameters:
name- the name of this observance component
-
Observance
protected Observance(String name, PropertyList<Property> properties)
Constructor protected to enforce use of sub-classes from this library.- Parameters:
name- the name of the time typeproperties- a list of properties
-
-
Method Detail
-
validate
public final void validate(boolean recurse) throws ValidationExceptionPerform validation on a component.- Specified by:
validatein classComponent- Parameters:
recurse- indicates whether to validate the component's properties- Throws:
ValidationException- where the component is not in a valid state
-
getLatestOnset
public final Date getLatestOnset(Date date)
Returns the latest applicable onset of this observance for the specified date.- Parameters:
date- the latest date that an observance onset may occur- Returns:
- the latest applicable observance date or null if there is no applicable observance onset for the specified date
-
getStartDate
public final DtStart getStartDate()
Returns the mandatory dtstart property.- Returns:
- the DTSTART property or null if not specified
-
getOffsetFrom
public final TzOffsetFrom getOffsetFrom()
Returns the mandatory tzoffsetfrom property.- Returns:
- the TZOFFSETFROM property or null if not specified
-
getOffsetTo
public final TzOffsetTo getOffsetTo()
Returns the mandatory tzoffsetto property.- Returns:
- the TZOFFSETTO property or null if not specified
-
-