org.apache.poi.ss.usermodel.helpers

## Class RowShifter

- java.lang.Object
- - org.apache.poi.ss.usermodel.helpers.BaseRowColShifter
  - - org.apache.poi.ss.usermodel.helpers.RowShifter

- Direct Known Subclasses:
    HSSFRowShifter, XSSFRowShifter

      public abstract class RowShifter
      extends BaseRowColShifter

  Helper for shifting rows up or down

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Sheet` | `sheet`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RowShifter(Sheet sh)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.util.List<CellRangeAddress>` | `shiftMergedRegions(int startRow, int endRow, int n)` Shifts, grows, or shrinks the merged regions due to a row shift.
    `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
    `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

    - ### Methods inherited from class org.apache.poi.ss.usermodel.helpers.BaseRowColShifter

      `shiftRange, updateConditionalFormatting, updateFormulas, updateHyperlinks, updateNamedRanges`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### sheet

          protected final Sheet sheet

  - ### Constructor Detail

    - #### RowShifter

          public RowShifter(Sheet sh)

  - ### Method Detail

    - #### shiftMergedRegions

          public java.util.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

Copyright 2020 The Apache Software Foundation or its licensors, as applicable.