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<Property> p)
        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()
        Returns:
        Returns the name.
      • getProperties

        public final PropertyList<Property> getProperties()
        Returns:
        Returns the properties.
      • getProperties

        public final <C extends PropertyPropertyList<C> getProperties​(String name)
        Convenience method for retrieving a list of named properties.
        Parameters:
        name - name of properties to retrieve
        Returns:
        a property list containing only properties with the specified name
      • getProperty

        public final <T extends Property> T getProperty​(String name)
        Convenience method for retrieving a named property.
        Parameters:
        name - name of the property to retrieve
        Returns:
        the first matching property in the property list with the specified name
      • getRequiredProperty

        protected final Property getRequiredProperty​(String name)
                                              throws ConstraintViolationException
        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

        public final void validate()
                            throws ValidationException
        Perform validation on a component and its properties.
        Throws:
        ValidationException - where the component is not in a valid state
      • validate

        public abstract void 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
      • validateProperties

        protected final void validateProperties()
                                         throws ValidationException
        Invoke validation on the component properties in its current state.
        Throws:
        ValidationException - where any of the component properties is not in a valid state
      • hashCode

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

        public final PeriodList calculateRecurrenceSet​(Period 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

        Parameters:
        period - a range to calculate recurrences for
        Returns:
        a list of periods