Package net.fortuna.ical4j.model
Class ComponentGroup<C extends Component>
- java.lang.Object
-
- net.fortuna.ical4j.model.ComponentGroup<C>
-
- All Implemented Interfaces:
ComponentListAccessor<C>
public class ComponentGroup<C extends Component> extends Object implements 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
Created by fortuna on 20/07/2017.group = new ComponentGroup( calendar.getComponents(Component.VEVENT), new Uid(uidString)); return group.getLatestRevision();
-
-
Constructor Summary
Constructors Constructor Description ComponentGroup(List<C> components, Uid uid)
ComponentGroup(List<C> components, Uid uid, RecurrenceId<?> recurrenceId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends Temporal>
List<Period<T>>calculateRecurrenceSet(Period<T> period)
Calculate all recurring periods for the specified date range.ComponentList<C>
getComponentList()
C
getLatestRevision()
Returns the latest component revision based on ascending sequence number and modified date.List<C>
getRevisions()
Apply filter to all components to create a subset containing components matching the specified UID.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.fortuna.ical4j.model.ComponentListAccessor
getComponent, getComponents
-
-
-
-
Method Detail
-
getComponentList
public ComponentList<C> getComponentList()
- Specified by:
getComponentList
in interfaceComponentListAccessor<C extends Component>
-
getRevisions
public List<C> getRevisions()
Apply filter to all components to create a subset containing components matching the specified UID.- Returns:
-
getLatestRevision
public C 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<T> 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:
Component.calculateRecurrenceSet(Period)
-
-