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 TypeMethodDescription@NonNull Difference_Return the length of the break, which is the difference betweengetNextRangeStart()andgetPreviousRangeEnd().@NonNull Point_Return the start of theConnectedRangeafter this gap.@NonNull Point_Return the end of theConnectedRangebefore this gap.
-
Method Details
-
getPreviousRangeEnd
@NonNull Point_ getPreviousRangeEnd()Return the end of theConnectedRangebefore this gap. For the gap between 6 and 10, this will return 6.- Returns:
- the item this gap is directly after
-
getNextRangeStart
@NonNull Point_ getNextRangeStart()Return the start of theConnectedRangeafter this gap. For the gap between 6 and 10, this will return 10.- Returns:
- the item this gap is directly before
-
getLength
@NonNull 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:
- the length of this break
-