Class RowShifter

    • Field Detail

      • sheet

        protected final Sheet sheet
    • Constructor Detail

      • RowShifter

        public RowShifter​(Sheet sh)
    • Method Detail

      • shiftMergedRegions

        public List<CellRangeAddress> shiftMergedRegions​(int startRow,
                                                         int endRow,
                                                         int n)
        Shifts, grows, or shrinks the merged regions due to a row shift. Merged regions that are completely overlaid by shifting will be deleted.
        Specified by:
        shiftMergedRegions in class BaseRowColShifter
        Parameters:
        startRow - the row to start shifting
        endRow - the row to end shifting
        n - the number of rows to shift
        Returns:
        an array of affected merged regions, doesn't contain deleted ones
      • validateShiftParameters

        public static void validateShiftParameters​(int firstShiftColumnIndex,
                                                   int lastShiftColumnIndex,
                                                   int step)
        Verify that the given column indices and step denote a valid range of columns to shift
        Parameters:
        firstShiftColumnIndex - the column to start shifting
        lastShiftColumnIndex - the column to end shifting
        step - length of the shifting step
      • validateShiftLeftParameters

        public static void validateShiftLeftParameters​(int firstShiftColumnIndex,
                                                       int lastShiftColumnIndex,
                                                       int step)
        Verify that the given column indices and step denote a valid range of columns to shift to the left
        Parameters:
        firstShiftColumnIndex - the column to start shifting
        lastShiftColumnIndex - the column to end shifting
        step - length of the shifting step