Top Description Fields Constructors Methods
org.apache.poi.ss.usermodel.helpers

public abstract Class RowShifter

extends BaseRowColShifter
Class Inheritance
Known Direct Subclasses
org.apache.poi.hssf.usermodel.helpers.HSSFRowShifter
Imports
java.util.ArrayList, .HashSet, .List, .Set, org.apache.poi.ss.usermodel.Sheet, org.apache.poi.ss.util.CellRangeAddress, org.apache.poi.util.LocaleUtil

Helper for shifting rows up or down

Field Summary

Modifier and TypeField and Description
protected final Sheet

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private boolean
removalNeeded(CellRangeAddress merged, int startRow, int endRow, int n)

public List<CellRangeAddress>

Returns:

an array of affected merged regions, doesn't contain deleted ones
shiftMergedRegions
(int
the row to start shifting
startRow
,
int
the row to end shifting
endRow
,
int
the number of rows to shift
n
)

Implements abstract org.apache.poi.ss.usermodel.helpers.BaseRowColShifter.shiftMergedRegions.

Shifts, grows, or shrinks the merged regions due to a row shift.

public static void
validateShiftLeftParameters(int
the column to start shifting
firstShiftColumnIndex
,
int
the column to end shifting
lastShiftColumnIndex
,
int
length of the shifting step
step
)

Verify that the given column indices and step denote a valid range of columns to shift to the left

public static void
validateShiftParameters(int
the column to start shifting
firstShiftColumnIndex
,
int
the column to end shifting
lastShiftColumnIndex
,
int
length of the shifting step
step
)

Verify that the given column indices and step denote a valid range of columns to shift

Inherited from org.apache.poi.ss.usermodel.helpers.BaseRowColShifter:
shiftRangeupdateConditionalFormattingupdateFormulasupdateHyperlinksupdateNamedRanges

Field Detail

sheetback to summary
protected final Sheet sheet

Constructor Detail

RowShifterback to summary
public RowShifter(Sheet sh)

Method Detail

removalNeededback to summary
private boolean removalNeeded(CellRangeAddress merged, int startRow, int endRow, int n)
shiftMergedRegionsback to summary
public List<CellRangeAddress> shiftMergedRegions(int startRow, int endRow, int n)

Implements abstract org.apache.poi.ss.usermodel.helpers.BaseRowColShifter.shiftMergedRegions.

Shifts, grows, or shrinks the merged regions due to a row shift. Merged regions that are completely overlaid by shifting will be deleted.

Parameters
startRow:int

the row to start shifting

endRow:int

the row to end shifting

n:int

the number of rows to shift

Returns:List<CellRangeAddress>

an array of affected merged regions, doesn't contain deleted ones

Annotations
@Override
validateShiftLeftParametersback to summary
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:int

the column to start shifting

lastShiftColumnIndex:int

the column to end shifting

step:int

length of the shifting step

validateShiftParametersback to summary
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:int

the column to start shifting

lastShiftColumnIndex:int

the column to end shifting

step:int

length of the shifting step