public class SimplifiedIntervalList extends LinkedList<org.joda.time.Interval>
Modifier and Type | Class and Description |
---|---|
static class |
SimplifiedIntervalList.IsSubinterval
A predicate for testing whether the test interval is a complete subinterval of part of the supply of intervals.
|
static class |
SimplifiedIntervalList.SkippingIntervalPredicate
A predicate to scan a Simplified Interval List using an iterator and a test predicate.
|
Modifier and Type | Field and Description |
---|---|
protected Function<Iterator<org.joda.time.Interval>,org.joda.time.Interval> |
getNextIfAvailable
Function to iterate an iterator if it has a next element, otherwise return null.
|
modCount
Constructor and Description |
---|
SimplifiedIntervalList()
Constructor.
|
SimplifiedIntervalList(Collection<org.joda.time.Interval> intervals)
Simplify then build a list.
|
SimplifiedIntervalList(SimplifiedIntervalList intervals)
If the intervals are already simplified, simply copy the list.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(org.joda.time.Interval e)
Only internal calls to linked list mutators should be used to change the list.
|
List<org.joda.time.Interval> |
asList()
Method to convert SimplifiedIntervalList as regular list to address the deserialization issues.
|
static Collector<org.joda.time.Interval,SimplifiedIntervalList,SimplifiedIntervalList> |
getCollector()
Build a collector which appends overlapping intervals, merging and simplifying as it goes.
|
SimplifiedIntervalList |
intersect(SimplifiedIntervalList that)
Return the intersection of all subintervals in two interval lists.
|
Iterator<org.joda.time.Interval> |
periodIterator(org.joda.time.ReadablePeriod readablePeriod)
Create an Iterator using IntervalPeriodInterators to all intervals of this list broken up into pieces of size
period.
|
static SimplifiedIntervalList |
simplifyIntervals(Collection<org.joda.time.Interval>... intervals)
Takes one or more lists of intervals, and combines them into a single, sorted list with the minimum number of
intervals needed to capture exactly the same instants as the original intervals.
|
SimplifiedIntervalList |
subtract(SimplifiedIntervalList that)
Return the subtracted list of all intervals in this that are not in that.
|
SimplifiedIntervalList |
union(SimplifiedIntervalList that)
Return the union of this simplified interval list and the intervals of another.
|
add, addAll, addAll, addFirst, addLast, clear, clone, contains, descendingIterator, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, set, size, spliterator, toArray, toArray
iterator
equals, hashCode, listIterator, removeRange, subList
containsAll, isEmpty, removeAll, retainAll, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
containsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, replaceAll, retainAll, sort, subList
parallelStream, removeIf, stream
public SimplifiedIntervalList()
public SimplifiedIntervalList(Collection<org.joda.time.Interval> intervals)
intervals
- A collection of intervalspublic SimplifiedIntervalList(SimplifiedIntervalList intervals)
intervals
- A simplified list of intervalspublic List<org.joda.time.Interval> asList()
@SafeVarargs public static SimplifiedIntervalList simplifyIntervals(Collection<org.joda.time.Interval>... intervals)
If any subintervals of the input collection abut or overlap they will be replaced with a single, combined interval.
Examples:
intervals
- The collection(s) of intervals being collatedpublic boolean add(org.joda.time.Interval e)
add
in interface Collection<org.joda.time.Interval>
add
in interface Deque<org.joda.time.Interval>
add
in interface List<org.joda.time.Interval>
add
in interface Queue<org.joda.time.Interval>
add
in class LinkedList<org.joda.time.Interval>
e
- Any element to be addedpublic static Collector<org.joda.time.Interval,SimplifiedIntervalList,SimplifiedIntervalList> getCollector()
public SimplifiedIntervalList union(SimplifiedIntervalList that)
that
- A simplified list of intervalspublic SimplifiedIntervalList intersect(SimplifiedIntervalList that)
that
- A simplified list of intervalspublic SimplifiedIntervalList subtract(SimplifiedIntervalList that)
that
- A simplified list of intervalspublic Iterator<org.joda.time.Interval> periodIterator(org.joda.time.ReadablePeriod readablePeriod)
readablePeriod
- The period to chunk subintervals into.Copyright © 2016–2018 Yahoo! Inc.. All rights reserved.