net.fortuna.ical4j.model

Class Component

Implemented Interfaces:
Serializable

public abstract class Component
extends java.lang.Object
implements Serializable

$Id: Component.java,v 1.29 2008/12/16 12:34:53 fortuna Exp $ [Apr 5, 2004] Defines an iCalendar component. Subclasses of this class provide additional validation and typed values for specific iCalendar components.

Field Summary

static String
AVAILABLE
static String
BEGIN
static String
END
static String
EXPERIMENTAL_PREFIX
static String
VALARM
static String
VAVAILABILITY
static String
VEVENT
static String
VFREEBUSY
static String
VJOURNAL
static String
VTIMEZONE
static String
VTODO
static String
VVENUE

Constructor Summary

Component(String s)
Constructs a new component containing no properties.
Component(String s, PropertyList p)
Constructor made protected to enforce the use of ComponentFactory for component instantiation.

Method Summary

PeriodList
calculateRecurrenceSet(Period period)
Calculates the recurrence set for this component using the specified period.
Component
copy()
Create a (deep) copy of this component.
boolean
equals(Object arg0)
Uses EqualsBuilder to test equality.
String
getName()
PropertyList
getProperties()
PropertyList
getProperties(String name)
Convenience method for retrieving a list of named properties.
Property
getProperty(String name)
Convenience method for retrieving a named property.
int
hashCode()
Uses HashCodeBuilder to build hashcode.
String
toString()
void
validate()
Perform validation on a component and its properties.
abstract void
validate(boolean recurse)
Perform validation on a component.
protected void
validateProperties()
Invoke validation on the component properties in its current state.

Field Details

AVAILABLE

public static final String AVAILABLE

BEGIN

public static final String BEGIN

END

public static final String END

EXPERIMENTAL_PREFIX

public static final String EXPERIMENTAL_PREFIX

VALARM

public static final String VALARM

VAVAILABILITY

public static final String VAVAILABILITY

VEVENT

public static final String VEVENT

VFREEBUSY

public static final String VFREEBUSY

VJOURNAL

public static final String VJOURNAL

VTIMEZONE

public static final String VTIMEZONE

VTODO

public static final String VTODO

VVENUE

public static final String VVENUE

Constructor Details

Component

protected Component(String s)
Constructs a new component containing no properties.
Parameters:
s - a component name

Component

protected Component(String s,
                    PropertyList p)
Constructor made protected to enforce the use of ComponentFactory for component instantiation.
Parameters:
s - component name
p - a list of properties

Method Details

calculateRecurrenceSet

public final PeriodList calculateRecurrenceSet(Period period)
Calculates the recurrence set for this component using the specified period. The recurrence set is derived from a combination of the event start date, recurrence rules and dates, and exception rules and dates. Note that component transparency and anniversary-style dates do not affect the resulting intersection.
Parameters:
period -
Returns:

copy

public Component copy()
            throws ParseException,
                   IOException,
                   URISyntaxException
Create a (deep) copy of this component.
Returns:
the component copy

equals

public boolean equals(Object arg0)
Uses EqualsBuilder to test equality. Two components are equal if and only if their name and property lists are equal.

getName

public final String getName()
Returns:
Returns the name.

getProperties

public final PropertyList getProperties()
Returns:
Returns the properties.

getProperties

public final PropertyList getProperties(String name)
Convenience method for retrieving a list of named properties.
Parameters:
name - name of properties to retrieve
Returns:
a property list containing only properties with the specified name

getProperty

public final Property getProperty(String name)
Convenience method for retrieving a named property.
Parameters:
name - name of the property to retrieve
Returns:
the first matching property in the property list with the specified name

hashCode

public int hashCode()
Uses HashCodeBuilder to build hashcode.

toString

public String toString()
See Also:
java.lang.Object.toString()

validate

public final void validate()
            throws ValidationException
Perform validation on a component and its properties.

validate

public abstract void validate(boolean recurse)
            throws ValidationException
Perform validation on a component.
Parameters:
recurse - indicates whether to validate the component's properties

validateProperties

protected final void validateProperties()
            throws ValidationException
Invoke validation on the component properties in its current state.