Package com.redwood.scheduler.api.date
Class Periods
- java.lang.Object
- 
- java.util.AbstractCollection<E>
- 
- java.util.AbstractList<E>
- 
- java.util.ArrayList<Period>
- 
- com.redwood.scheduler.api.date.Periods
 
 
 
 
- 
- All Implemented Interfaces:
- Serializable,- Cloneable,- Iterable<Period>,- Collection<Period>,- List<Period>,- RandomAccess
 
 public class Periods extends ArrayList<Period> ArrayList that implements set operations on Period elements.- See Also:
- Serialized Form
 
- 
- 
Field Summary- 
Fields inherited from class java.util.AbstractListmodCount
 
- 
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Comparator<Period>getNextOpenComparator()PeriodgetPeriod(int aIndex)Typesafe accessor to the element at aIndex.intgetPeriodFor(DateTimeZone date)Find the index for the period that contains date.voidintersect(Period aPeriod)Intersects this periods with aPeriod.voidintersect(Periods aPeriods)Replaces the elements from this with the intersection of this periods with aPeriods.voidjoinOverlappingIntervals()Joins overlapping and continuing periods.voidsubtract(Period aPeriod)Excludes aPeriod from this periods.voidsubtract(Periods aPeriods)Excludes aPeriods from this periods.- 
Methods inherited from class java.util.ArrayListadd, add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
 - 
Methods inherited from class java.util.AbstractCollectioncontainsAll, toString
 - 
Methods inherited from class java.lang.Objectfinalize, getClass, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface java.util.CollectionparallelStream, stream, toArray
 - 
Methods inherited from interface java.util.ListcontainsAll
 
- 
 
- 
- 
- 
Constructor Detail- 
Periodspublic Periods() 
 - 
Periodspublic Periods(Periods copyFrom) 
 
- 
 - 
Method Detail- 
getPeriodpublic Period getPeriod(int aIndex) Typesafe accessor to the element at aIndex.- Parameters:
- aIndex- point in time in a period.
- Returns:
- the Period at aIndex.
 
 - 
getPeriodForpublic 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
 
 - 
intersectpublic void intersect(Periods aPeriods) Replaces the elements from this with the intersection of this periods with aPeriods.- Parameters:
- aPeriods- are the periods to exclude.
 
 - 
intersectpublic void intersect(Period aPeriod) Intersects this periods with aPeriod.- Parameters:
- aPeriod- is the period to intersect with.
 
 - 
joinOverlappingIntervalspublic void joinOverlappingIntervals() Joins overlapping and continuing periods. Assumes the periods are sorted on begin time.
 - 
subtractpublic void subtract(Periods aPeriods) Excludes aPeriods from this periods.- Parameters:
- aPeriods- are the periods to exclude.
 
 - 
subtractpublic void subtract(Period aPeriod) Excludes aPeriod from this periods.- Parameters:
- aPeriod- is the period to exclude.
 
 - 
getNextOpenComparatorpublic static Comparator<Period> getNextOpenComparator() 
 
- 
 
-