Class Periods

    • Constructor Detail

      • Periods

        public Periods()
      • Periods

        public Periods​(Periods copyFrom)
    • Method Detail

      • getPeriod

        public Period getPeriod​(int aIndex)
        Typesafe accessor to the element at aIndex.
        Parameters:
        aIndex - point in time in a period.
        Returns:
        the Period at aIndex.
      • getPeriodFor

        public int getPeriodFor​(DateTimeZone date)
        Find the index for the period that contains date. The period is extended until the next open period.
        Parameters:
        date - is the DateTimeZone to look for
        Returns:
        index of the search key, if it is contained in the list
      • intersect

        public void intersect​(Periods aPeriods)
        Replaces the elements from this with the intersection of this periods with aPeriods.
        Parameters:
        aPeriods - are the periods to exclude.
      • intersect

        public void intersect​(Period aPeriod)
        Intersects this periods with aPeriod.
        Parameters:
        aPeriod - is the period to intersect with.
      • joinOverlappingIntervals

        public void joinOverlappingIntervals()
        Joins overlapping and continuing periods. Assumes the periods are sorted on begin time.
      • subtract

        public void subtract​(Periods aPeriods)
        Excludes aPeriods from this periods.
        Parameters:
        aPeriods - are the periods to exclude.
      • subtract

        public void subtract​(Period aPeriod)
        Excludes aPeriod from this periods.
        Parameters:
        aPeriod - is the period to exclude.
      • getNextOpenComparator

        public static Comparator<Period> getNextOpenComparator()