Class PeriodList<T extends Temporal>

  • All Implemented Interfaces:

    public class PeriodList<T extends Temporal>
    extends Object
    implements Serializable
    $Id$ [23-Apr-2004] Defines a list of iCalendar periods. This class encapsulates a collection of naturally sorted periods that SHOULD conform to a common set of rules, including temporal type, applicable timezone and string representation (format). Results for a consumed time query will have the same temporal type, format type and (where applicable) timezone as the event start date. Results for a free-busy query will always be defined in UTC time (i.e. using temporal type Instant) NOTE: By implementing the java.util.SortedSet interface period lists will always be sorted according to natural ordering.
    See Also:
    Serialized Form
    • Method Detail

      • parse

        public static <T extends TemporalPeriodList<T> parse​(String aValue)
        Parses the specified string representation to create a list of periods.
        aValue - a string representation of a list of periods
        DateTimeParseException - thrown when an invalid string representation of a period list is provided
      • remove

        public final PeriodList<T> remove​(Object period)
        Remove a period from the list.
        period - the period to remove
        true if the list contained the specified period
        See Also:
      • normalise

        public final PeriodList<T> normalise()
        Returns a normalised version of this period list. Normalisation includes combining overlapping periods, removing periods contained by other periods, combining adjacent periods, and removing periods that consume no time. NOTE: If the period list is already normalised then this period list is returned.
        a period list
      • add

        public final PeriodList<T> add​(PeriodList<T> periods)
        A convenience method that combines all the periods in the specified list to this list. The result returned is a new PeriodList instance, except where no periods are specified in the arguments. In such cases this instance is returned. Normalisation is also performed automatically after all periods have been added.
        periods - a list of periods to add
        a period list instance
      • subtract

        public final PeriodList<T> subtract​(PeriodList<T> subtractions)
        Subtracts the intersection of this list with the specified list of periods from this list and returns the results as a new period list. If no intersection is identified this list is returned.
        subtractions - a list of periods to subtract from this list
        a period list
      • hashCode

        public int hashCode()
        hashCode in class Object