Class CellRangeUtil

    • Method Detail

      • mergeCellRanges

        public static CellRangeAddress[] mergeCellRanges​(CellRangeAddress[] cellRanges)
        Do all possible cell merges between cells of the list so that:
        • if a cell range is completely inside of another cell range, it gets removed from the list
        • if two cells have a shared border, merge them into one bigger cell range
        Parameters:
        cellRanges - the ranges to merge
        Returns:
        list of merged cell ranges
      • contains

        public static boolean contains​(CellRangeAddress crA,
                                       CellRangeAddress crB)
        Check if cell range A contains cell range B (B <= A) TODO: move this into CellRangeAddressBase
        Parameters:
        crA - cell range A
        crB - cell range B
        Returns:
        true if cell range A contains cell range B
      • hasExactSharedBorder

        public static boolean hasExactSharedBorder​(CellRangeAddress crA,
                                                   CellRangeAddress crB)
        Check if the two cell ranges have a shared border.
        Returns:
        true if the ranges have a complete shared border (i.e. the two ranges together make a simple rectangular region.