Class RowShifter
- java.lang.Object
-
- org.apache.poi.ss.usermodel.helpers.BaseRowColShifter
-
- org.apache.poi.ss.usermodel.helpers.RowShifter
-
- Direct Known Subclasses:
HSSFRowShifter
public abstract class RowShifter extends BaseRowColShifter
Helper for shifting rows up or down
-
-
Constructor Summary
Constructors Constructor Description RowShifter(Sheet sh)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description List<CellRangeAddress>shiftMergedRegions(int startRow, int endRow, int n)Shifts, grows, or shrinks the merged regions due to a row shift.static voidvalidateShiftLeftParameters(int firstShiftColumnIndex, int lastShiftColumnIndex, int step)Verify that the given column indices and step denote a valid range of columns to shift to the leftstatic voidvalidateShiftParameters(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
-
-
-
-
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:
shiftMergedRegionsin classBaseRowColShifter- Parameters:
startRow- the row to start shiftingendRow- the row to end shiftingn- 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 shiftinglastShiftColumnIndex- the column to end shiftingstep- 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 shiftinglastShiftColumnIndex- the column to end shiftingstep- length of the shifting step
-
-