Interface ConnectedRange<Range_,Point_ extends Comparable<Point_>,Difference_ extends Comparable<Difference_>>

Type Parameters:
Range_ - The type of range in the collection.
Point_ - The type of the start and end points for each range.
Difference_ - The type of difference between start and end points.
All Superinterfaces:
Iterable<Range_>

public interface ConnectedRange<Range_,Point_ extends Comparable<Point_>,Difference_ extends Comparable<Difference_>> extends Iterable<Range_>
Represents a collection of ranges that are connected, meaning the union of all the ranges results in the range [getStart(), getEnd()) without gaps.
  • Method Details

    • getContainedRangeCount

      int getContainedRangeCount()
      Get the number of ranges contained by this ConnectedRange.
      Returns:
      the number of ranges contained by this ConnectedRange.
    • hasOverlap

      boolean hasOverlap()
      True if this ConnectedRange has at least one pair of ranges that overlaps each other, false otherwise.
      Returns:
      true iff there at least one pair of overlapping ranges in this ConnectedRange.
    • getMinimumOverlap

      int getMinimumOverlap()
      Get the minimum number of overlapping ranges for any point contained by this ConnectedRange.
      Returns:
      the minimum number of overlapping ranges for any point in this ConnectedRange.
    • getMaximumOverlap

      int getMaximumOverlap()
      Get the maximum number of overlapping ranges for any point contained by this ConnectedRange.
      Returns:
      the maximum number of overlapping ranges for any point in this ConnectedRange.
    • getLength

      @NonNull Difference_ getLength()
      Get the length of this ConnectedRange.
      Returns:
      The difference between getEnd() and getStart().
    • getStart

      @NonNull Point_ getStart()
      Gets the first start point represented by this ConnectedRange.
      Returns:
      never null, the first start point represented by this ConnectedRange.
    • getEnd

      @NonNull Point_ getEnd()
      Gets the last end point represented by this ConnectedRange.
      Returns:
      the last end point represented by this ConnectedRange.