java.lang.Object
net.fortuna.ical4j.model.ComponentGroup<C>
- All Implemented Interfaces:
ComponentContainer<C>,ComponentListAccessor<C>
Support for operations applicable to a group of components. Typically, this class is used to manage
component revisions (whereby each revision is a separate component), and the resulting output of
such group functions.
Example - Find the latest revision of an event:
Calendar calendar = ...
String uidString = ...
ComponentGroup group = new ComponentGroup(
calendar.getComponents(Component.VEVENT),
new Uid(uidString));
return group.getLatestRevision();
Created by fortuna on 20/07/2017.-
Constructor Summary
ConstructorsConstructorDescriptionComponentGroup(List<C> components, Uid uid) ComponentGroup(List<C> components, Uid uid, RecurrenceId<?> recurrenceId) ComponentGroup(ComponentList<C> components, Uid uid) ComponentGroup(ComponentList<C> components, Uid uid, RecurrenceId<?> recurrenceId) ComponentGroup(Uid uid) Construct a component group filtered onUid.ComponentGroup(Uid uid, RecurrenceId<?> recurrenceId) Construct a component group filtered on a specific recurrence of aUid. -
Method Summary
Modifier and TypeMethodDescription<T extends ComponentContainer<C>>
TAdd a subcomponent to this component.calculateRecurrenceSet(Period<? extends Temporal> period) Calculate all recurring periods for the specified date range.Returns the latest component revision based on ascending sequence number and modified date.Apply filter to all components to create a subset containing components matching the specified UID.<T extends ComponentContainer<C>>
TAdd a subcomponent to this component whilst removing all other subcomponents with the same component name.voidsetComponentList(ComponentList<C> components) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.fortuna.ical4j.model.ComponentContainer
remove, withMethods inherited from interface net.fortuna.ical4j.model.ComponentListAccessor
getComponent, getComponents
-
Constructor Details
-
ComponentGroup
Construct a component group filtered onUid. Note that this will exclude any recurrence instances as specified by the presence of aRecurrenceIdproperty.- Parameters:
uid- the UID to filter on
-
ComponentGroup
Construct a component group filtered on a specific recurrence of aUid. Note that this will only include revisions of a single recurrence instance as specified by theRecurrenceIdproperty.- Parameters:
uid- the UID to filter on
-
ComponentGroup
-
ComponentGroup
-
ComponentGroup
-
ComponentGroup
-
-
Method Details
-
getComponentList
- Specified by:
getComponentListin interfaceComponentListAccessor<C extends Component>
-
setComponentList
- Specified by:
setComponentListin interfaceComponentContainer<C extends Component>
-
add
Description copied from interface:ComponentContainerAdd a subcomponent to this component.- Specified by:
addin interfaceComponentContainer<C extends Component>- Parameters:
component- the subcomponent to add- Returns:
- a reference to this component to support method chaining
-
replace
Description copied from interface:ComponentContainerAdd a subcomponent to this component whilst removing all other subcomponents with the same component name.- Specified by:
replacein interfaceComponentContainer<C extends Component>- Parameters:
component- the subcomponent to add- Returns:
- a reference to the component to support method chaining
-
getRevisions
Apply filter to all components to create a subset containing components matching the specified UID.- Returns:
-
getLatestRevision
Returns the latest component revision based on ascending sequence number and modified date.- Returns:
-
calculateRecurrenceSet
public <T extends Temporal> List<Period<T>> calculateRecurrenceSet(Period<? extends Temporal> period) Calculate all recurring periods for the specified date range. This method will take all revisions into account when generating the set. Component revisions with a RECURRENCE_ID property are processed last, as they override instances in the default recurrence set.- Parameters:
period-- Returns:
- See Also:
-