Class CellRangeAddress

    • Constructor Detail

      • CellRangeAddress

        public CellRangeAddress​(int firstRow,
                                int lastRow,
                                int firstCol,
                                int lastCol)
        Creates new cell range. Indexes are zero-based.
        Parameters:
        firstRow - Index of first row
        lastRow - Index of last row (inclusive), must be equal to or larger than firstRow
        firstCol - Index of first column
        lastCol - Index of last column (inclusive), must be equal to or larger than firstCol
    • Method Detail

      • copy

        public CellRangeAddress copy()
        Returns:
        a deep copy of the implementing class / instance
      • getEncodedSize

        public static int getEncodedSize​(int numberOfItems)
      • formatAsString

        public String formatAsString()
        Returns:
        the text format of this range. Single cell ranges are formatted like single cell references (e.g. 'A1' instead of 'A1:A1').
      • formatAsString

        public String formatAsString​(String sheetName,
                                     boolean useAbsoluteAddress)
        Returns:
        the text format of this range using specified sheet name.
      • valueOf

        public static CellRangeAddress valueOf​(String ref)
        Creates a CellRangeAddress from a cell range reference string.
        Parameters:
        ref - usually a standard area ref (e.g. "B1:D8"). May be a single cell ref (e.g. "B5") in which case the result is a 1 x 1 cell range. May also be a whole row range (e.g. "3:5"), or a whole column range (e.g. "C:F")