Interface RangeGap<Point_ extends Comparable<Point_>,Difference_ extends Comparable<Difference_>>
- Type Parameters:
Point_- The type for the ranges' start and end pointsDifference_- The type of difference between values in the sequence
public interface RangeGap<Point_ extends Comparable<Point_>,Difference_ extends Comparable<Difference_>>
A
RangeGap is a gap between two consecutive ConnectedRanges.
For instance, the list [(1,3),(2,4),(3,5),(7,8)] has a grap of length 2 between 5 and 7.-
Method Summary
Modifier and TypeMethodDescriptionReturn the length of the break, which is the difference betweengetNextRangeStart()andgetPreviousRangeEnd().Return the start of theConnectedRangeafter this gap.Return the end of theConnectedRangebefore this gap.
-
Method Details
-
getPreviousRangeEnd
Point_ getPreviousRangeEnd()Return the end of theConnectedRangebefore this gap. For the gap between 6 and 10, this will return 6.- Returns:
- never null, the item this gap is directly after
-
getNextRangeStart
Point_ getNextRangeStart()Return the start of theConnectedRangeafter this gap. For the gap between 6 and 10, this will return 10.- Returns:
- never null, the item this gap is directly before
-
getLength
Difference_ getLength()Return the length of the break, which is the difference betweengetNextRangeStart()andgetPreviousRangeEnd(). For the gap between 6 and 10, this will return 4.- Returns:
- never null, the length of this break
-