Class Intervals
Defined in: interval.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Set of functions to extract a set of intervals such that no interval
overlaps any other interval.
|
Method Attributes | Method Name and Description |
---|---|
<static> |
Intervals.accumulateByInterval(intervals, comparator, accumulator)
Break it up.
|
<static> |
Intervals.splitIntervals(i1, i2, accumulator)
Takes two Intervals as input and returns an array of 1 to 3 Intervals
based on the amount of overlap.
|
Class Detail
Intervals()
Set of functions to extract a set of intervals such that no interval
overlaps any other interval. Overlaps will be broken up into distinct
intervals with overlaps having their values combined.
- Requires:
- MinHeap
Method Detail
<static>
Intervals.accumulateByInterval(intervals, comparator, accumulator)
Break it up.
- Parameters:
- intervals
- Array of Interval objects in ascending order based on Interval.comparator
- comparator
- accumulator
- Returns:
- Array of Interval objects of length L where: 1 <= L <= 3.
<static>
Intervals.splitIntervals(i1, i2, accumulator)
Takes two Intervals as input and returns an array of 1 to 3 Intervals
based on the amount of overlap.
Input constraint: Start time for i1 must be less than or equal to
start time for i2.
Intervals returned are based on overlap of i1 and i2. The intervals
will be split into distinct intervals with overlapping segments
combining the values of both intervals.
Intervals returned will be in ascending order.
- Parameters:
- i1
- Interval 1.
- i2
- Interval 2 with the constraint that i1.start <= i2.start;
- accumulator
- Override of default accumulator. Must accept two values and return a single value representing the "accumulated" value of the two intervals.
- Returns:
- Array of Interval objects of length L where: 1 <= L <= 3.