org.apache.poi.ss.usermodel.helpers

## Class ColumnShifter

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

- Direct Known Subclasses:
    HSSFColumnShifter, XSSFColumnShifter

      @Beta
      public abstract class ColumnShifter
      extends BaseRowColShifter

  Helper for shifting columns up or down
  Since:
    POI 4.0.0

- - ### Field Summary

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

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ColumnShifter(Sheet sh)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `shiftColumns(int firstShiftColumnIndex, int lastShiftColumnIndex, int step)`
    `java.util.List<CellRangeAddress>` | `shiftMergedRegions(int startColumn, int endColumn, int n)` Shifts, grows, or shrinks the merged regions due to a column 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

    - #### ColumnShifter

          public ColumnShifter(Sheet sh)

  - ### Method Detail

    - #### shiftMergedRegions

          public java.util.List<CellRangeAddress> shiftMergedRegions(int startColumn,
                                                                     int endColumn,
                                                                     int n)

      Shifts, grows, or shrinks the merged regions due to a column shift. Merged regions that are completely overlaid by shifting will be deleted.
      Specified by:
        `shiftMergedRegions` in class `BaseRowColShifter`
      Parameters:
        `startColumn` - the column to start shifting
        `endColumn` - the column to end shifting
        `n` - the number of columns to shift
      Returns:
        an array of affected merged regions, doesn't contain deleted ones
      Since:
        POI 4.0.0

    - #### shiftColumns

          public void shiftColumns(int firstShiftColumnIndex,
                                   int lastShiftColumnIndex,
                                   int step)

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