Class Component

    • Constructor Detail

      • Component

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

        protected Component​(String s,
                            PropertyList p,
                            ComponentList<? extends Component> c)
        Constructor made protected to enforce the use of ComponentFactory for component instantiation.
        Parameters:
        s - component name
        p - a list of properties
    • Method Detail

      • getName

        public final String getName()
        Specified by:
        getName in class Content
        Returns:
        Returns the name.
      • getValue

        public String getValue()
        Specified by:
        getValue in class Content
        Returns:
        the content value
      • getProperties

        public <T extends PropertyList<T> getProperties()
      • validate

        public abstract ValidationResult validate​(boolean recurse)
                                           throws ValidationException
        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
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • newFactory

        protected abstract ComponentFactory<? extends Component> newFactory()
        Returns a new component factory used to create deep copies.
        Returns:
        a component factory instance
      • copy

        public <T extends Component> T copy()
        Create a (deep) copy of this component.
        Returns:
        the component copy
      • calculateRecurrenceSet

        public final <T extends TemporalSet<Period<T>> calculateRecurrenceSet​(Period<T> 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