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
        cellRanges - the ranges to merge
        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
        crA - cell range A
        crB - cell range B
        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.
        true if the ranges have a complete shared border (i.e. the two ranges together make a simple rectangular region.