net.fortuna.ical4j.model.component

Class Observance

Implemented Interfaces:
Comparable

public abstract class Observance
extends Component
implements Comparable

$Id: Observance.java,v 1.22 2008/12/16 12:34:53 fortuna Exp $ [05-Apr-2004] Defines an iCalendar sub-component representing a timezone observance. Class made abstract such that only Standard and Daylight instances are valid.

Field Summary

static String
DAYLIGHT
static String
STANDARD
one of 'standardc' or 'daylightc' MUST occur and each MAY occur more than once.

Constructor Summary

Observance(String name)
Constructs a timezone observance with the specified name and no properties.
Observance(String name, PropertyList properties)
Constructor protected to enforce use of sub-classes from this library.

Method Summary

int
compareTo(Object arg0)
int
compareTo(Observance arg0)
Date
getLatestOnset(Date date)
Returns the latest applicable onset of this observance for the specified date.
TzOffsetFrom
getOffsetFrom()
Returns the mandatory tzoffsetfrom property.
TzOffsetTo
getOffsetTo()
Returns the mandatory tzoffsetto property.
DtStart
getStartDate()
Returns the mandatory dtstart property.
void
validate(boolean recurse)

Field Details

DAYLIGHT

public static final String DAYLIGHT

STANDARD

public static final String STANDARD
one of 'standardc' or 'daylightc' MUST occur and each MAY occur more than once.

Constructor Details

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 properties)
Constructor protected to enforce use of sub-classes from this library.
Parameters:
name - the name of the time type
properties - a list of properties

Method Details

compareTo

public final int compareTo(Object arg0)

compareTo

public final int compareTo(Observance arg0)
Parameters:
arg0 -
Returns:

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

getOffsetFrom

public final TzOffsetFrom getOffsetFrom()
Returns the mandatory tzoffsetfrom property.
Returns:

getOffsetTo

public final TzOffsetTo getOffsetTo()
Returns the mandatory tzoffsetto property.
Returns:

getStartDate

public final DtStart getStartDate()
Returns the mandatory dtstart property.
Returns:

validate

public final void validate(boolean recurse)
            throws ValidationException
See Also:
net.fortuna.ical4j.model.Component.validate(boolean)