Package net.fortuna.ical4j.model
Class Component
java.lang.Object
net.fortuna.ical4j.model.Component
- All Implemented Interfaces:
Serializable,FluentComponent,PropertyContainer
- Direct Known Subclasses:
Available,CalendarComponent,Observance,Participant,VLocation,VResource
public abstract class Component
extends Object
implements Serializable, PropertyContainer, FluentComponent
$Id$ [Apr 5, 2004]
Defines an iCalendar component. Subclasses of this class provide additional validation and typed values for specific
iCalendar components.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringComponent token.static final StringComponent start token.protected final ComponentList<? extends Component>static final StringComponent end token.static final StringPrefix for non-standard components.static final StringComponent token.static final StringComponent token.static final StringComponent token.static final StringComponent token.static final StringComponent token.static final StringComponent token.static final StringComponent token.static final StringComponent token.static final StringComponent token.static final StringComponent token.static final StringComponent token. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructs a new component containing no properties.protectedComponent(String s, PropertyList<Property> p) protectedComponent(String s, PropertyList<Property> p, ComponentList<? extends Component> c) Constructor made protected to enforce the use ofComponentFactoryfor component instantiation. -
Method Summary
Modifier and TypeMethodDescriptionfinal PeriodListcalculateRecurrenceSet(Period period) Calculates the recurrence set for this component using the specified period.final <T extends Component>
Tcopy()Create a (deep) copy of this component.boolean<C extends Component>
Cfinal StringgetName()final PropertyList<Property>protected final PropertygetRequiredProperty(String name) Convenience method for retrieving a required named property.inthashCode()toString()validate()Perform validation on a component and its properties.abstract ValidationResultvalidate(boolean recurse) Perform validation on a component.protected ValidationResultInvoke validation on the component properties in its current state.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.fortuna.ical4j.model.FluentComponent
withPropertyMethods inherited from interface net.fortuna.ical4j.model.PropertyContainer
getProperties, getProperty
-
Field Details
-
BEGIN
Component start token.- See Also:
-
END
Component end token.- See Also:
-
PARTICIPANT
Component token.- See Also:
-
VLOCATION
Component token.- See Also:
-
VRESOURCE
Component token.- See Also:
-
VEVENT
Component token.- See Also:
-
VTODO
Component token.- See Also:
-
VJOURNAL
Component token.- See Also:
-
VFREEBUSY
Component token.- See Also:
-
VTIMEZONE
Component token.- See Also:
-
VALARM
Component token.- See Also:
-
VAVAILABILITY
Component token.- See Also:
-
VVENUE
Component token.- See Also:
-
AVAILABLE
Component token.- See Also:
-
EXPERIMENTAL_PREFIX
Prefix for non-standard components.- See Also:
-
components
-
-
Constructor Details
-
Component
Constructs a new component containing no properties.- Parameters:
s- a component name
-
Component
-
Component
Constructor made protected to enforce the use ofComponentFactoryfor component instantiation.- Parameters:
s- component namep- a list of properties
-
-
Method Details
-
toString
-
getName
- Returns:
- Returns the name.
-
getFluentTarget
- Specified by:
getFluentTargetin interfaceFluentComponent
-
getProperties
- Specified by:
getPropertiesin interfacePropertyContainer- Returns:
- Returns the properties.
-
getRequiredProperty
Convenience method for retrieving a required named property.- Parameters:
name- name of the property to retrieve- Returns:
- the first matching property in the property list with the specified name
- Throws:
ConstraintViolationException- when a property is not found
-
validate
Perform validation on a component and its properties.- Throws:
ValidationException- where the component is not in a valid state
-
validate
Perform validation on a component.- Parameters:
recurse- indicates whether to validate the component's properties- Throws:
ValidationException- where the component is not in a valid state
-
validateProperties
Invoke validation on the component properties in its current state.- Throws:
ValidationException- where any of the component properties is not in a valid state
-
equals
-
hashCode
public int hashCode() -
copy
Create a (deep) copy of this component.- Returns:
- the component copy
- Throws:
IOException- where an error occurs reading the component dataParseException- where parsing component data failsURISyntaxException- where component data contains an invalid URI
-
calculateRecurrenceSet
Calculates the recurrence set for this component using the specified period. The recurrence set is derived from a combination of the component 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.If an explicit DURATION is not specified, the effective duration of each returned period is derived from the DTSTART and DTEND or DUE properties. If the component has no DURATION, DTEND or DUE, the effective duration is set to PT0S
- Parameters:
period- a range to calculate recurrences for- Returns:
- a list of periods
-