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

public abstract Class ColumnShifter

extends BaseRowColShifter
Class Inheritance
Known Direct Subclasses
org.apache.poi.hssf.usermodel.helpers.HSSFColumnShifter
Annotations
@Beta
Imports
java.util.ArrayList, .HashSet, .List, .Set, org.apache.poi.ss.usermodel.Row, .Sheet, org.apache.poi.ss.util.CellRangeAddress, org.apache.poi.util.Beta

Helper for shifting columns up or down
Since
POI 4.0.0

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 startColumn, int endColumn, int n)

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

public List<CellRangeAddress>

Returns:

an array of affected merged regions, doesn't contain deleted ones
shiftMergedRegions
(int
the column to start shifting
startColumn
,
int
the column to end shifting
endColumn
,
int
the number of columns to shift
n
)

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

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

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

Field Detail

sheetback to summary
protected final Sheet sheet

Constructor Detail

ColumnShifterback to summary
public ColumnShifter(Sheet sh)

Method Detail

removalNeededback to summary
private boolean removalNeeded(CellRangeAddress merged, int startColumn, int endColumn, int n)
shiftColumnsback to summary
public void shiftColumns(int firstShiftColumnIndex, int lastShiftColumnIndex, int step)
shiftMergedRegionsback to summary
public List<CellRangeAddress> shiftMergedRegions(int startColumn, int endColumn, int n)

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

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

Parameters
startColumn:int

the column to start shifting

endColumn:int

the column to end shifting

n:int

the number of columns to shift

Returns:List<CellRangeAddress>

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

Annotations
@Override
Since
POI 4.0.0