java.lang.Object
net.fortuna.ical4j.model.Content
net.fortuna.ical4j.model.Component
- All Implemented Interfaces:
Serializable,Comparable<Component>,FluentComponent,PropertyContainer,PropertyListAccessor,Prototype<Component>
- Direct Known Subclasses:
Available,CalendarComponent,Observance,Participant,VAlarm,VLocation,VResource
public abstract class Component
extends Content
implements Prototype<Component>, Serializable, PropertyContainer, FluentComponent, Comparable<Component>
$Id$ [Apr 5, 2004]
Defines an iCalendar component. Subclasses of this class provide additional validation and typed values for specific
iCalendar components.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class net.fortuna.ical4j.model.Content
Content.Factory -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringComponent token.static final StringComponent start token.protected ComponentList<? extends Component>static final StringComponent end token.static final StringPrefix for non-standard components.static final StringComponent token.protected PropertyListstatic 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.Fields inherited from interface net.fortuna.ical4j.model.PropertyContainer
ADD_IF_NOT_PRESENT -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructs a new component containing no properties.protectedComponent(String s, PropertyList p) protectedComponent(String s, PropertyList p, ComponentList<? extends Component> c) Constructor made protected to enforce the use ofComponentFactoryfor component instantiation. -
Method Summary
Modifier and TypeMethodDescriptioncalculateRecurrenceSet(Period<? extends Temporal> period) Calculates the recurrence set for this component using the specified period.intcopy()Create a (deep) copy of this component.booleanfinal StringgetName()final PropertyListgetUid()Returns the UID property of this component if available.getValue()inthashCode()protected abstract ComponentFactory<? extends Component>Returns a new component factory used to create deep copies.voidsetPropertyList(PropertyList properties) 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
add, addAll, remove, removeAll, removeIf, replace, withMethods inherited from interface net.fortuna.ical4j.model.PropertyListAccessor
getProperties, getProperty, getProperty, getRequiredProperty, getRequiredProperty
-
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:
-
properties
-
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
-
getValue
-
getProperties
-
getFluentTarget
- Specified by:
getFluentTargetin interfaceFluentComponent
-
getPropertyList
- Specified by:
getPropertyListin interfacePropertyListAccessor- Returns:
- Returns the underlying property list.
-
setPropertyList
- Specified by:
setPropertyListin interfacePropertyContainer
-
getUid
Returns the UID property of this component if available.- Returns:
- a Uid instance, or null if no UID property exists
-
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() -
newFactory
Returns a new component factory used to create deep copies.- Returns:
- a component factory instance
-
copy
Create a (deep) copy of this component. -
calculateRecurrenceSet
public final <T extends Temporal> Set<Period<T>> calculateRecurrenceSet(Period<? extends Temporal> period) 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
NOTE: As a component may be defined in terms of floating date-time values (i.e. without a specific timezone), when calculating a recurrence set we must explicitly provide an applicable timezone for calculations.- Parameters:
period- a range that defines the boundary for calculations- Returns:
- a list of periods representing component occurrences within the specified boundary
-
compareTo
- Specified by:
compareToin interfaceComparable<Component>
-