Class SharedValueManager
- java.lang.Object
-
- org.apache.poi.hssf.record.aggregates.SharedValueManager
-
public final class SharedValueManager extends Object
Manages various auxiliary records while constructing aRowRecordsAggregate
:
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addArrayRecord(ArrayRecord ar)
Add specified Array Record.static SharedValueManager
create(SharedFormulaRecord[] sharedFormulaRecords, CellReference[] firstCells, ArrayRecord[] arrayRecords, TableRecord[] tableRecords)
static SharedValueManager
createEmpty()
ArrayRecord
getArrayRecord(int firstRow, int firstColumn)
SharedValueRecordBase
getRecordForFirstCell(FormulaRecordAggregate agg)
Gets theSharedValueRecordBase
record if it should be encoded immediately after the formula record contained in the specifiedFormulaRecordAggregate
agg.SharedFormulaRecord
linkSharedFormulaRecord(CellReference firstCell, FormulaRecordAggregate agg)
CellRangeAddress8Bit
removeArrayFormula(int rowIndex, int columnIndex)
Removes theArrayRecord
for the cell group containing the specified cell.void
unlink(SharedFormulaRecord sharedFormulaRecord)
Converts allFormulaRecord
s handled bysharedFormulaRecord
to plain unshared formulas
-
-
-
Method Detail
-
createEmpty
public static SharedValueManager createEmpty()
- Returns:
- a new empty SharedValueManager.
-
create
public static SharedValueManager create(SharedFormulaRecord[] sharedFormulaRecords, CellReference[] firstCells, ArrayRecord[] arrayRecords, TableRecord[] tableRecords)
-
linkSharedFormulaRecord
public SharedFormulaRecord linkSharedFormulaRecord(CellReference firstCell, FormulaRecordAggregate agg)
- Parameters:
firstCell
- as extracted from theExpPtg
from the cell's formula.- Returns:
- never
null
-
getRecordForFirstCell
public SharedValueRecordBase getRecordForFirstCell(FormulaRecordAggregate agg)
Gets theSharedValueRecordBase
record if it should be encoded immediately after the formula record contained in the specifiedFormulaRecordAggregate
agg. Note - the shared value record always appears after the first formula record in the group. For arrays and tables the first formula is always the in the top left cell. However, since shared formula groups can be sparse and/or overlap, the first formula may not actually be in the top left cell.- Returns:
- the SHRFMLA, TABLE or ARRAY record for the formula cell, if it is the first cell of
a table or array region.
null
if the formula cell is not shared/array/table, or if the specified formula is not the first in the group.
-
unlink
public void unlink(SharedFormulaRecord sharedFormulaRecord)
Converts allFormulaRecord
s handled bysharedFormulaRecord
to plain unshared formulas
-
addArrayRecord
public void addArrayRecord(ArrayRecord ar)
Add specified Array Record.
-
removeArrayFormula
public CellRangeAddress8Bit removeArrayFormula(int rowIndex, int columnIndex)
Removes theArrayRecord
for the cell group containing the specified cell. The caller should clear (set blank) all cells in the returned range.- Returns:
- the range of the array formula which was just removed. Never
null
.
-
getArrayRecord
public ArrayRecord getArrayRecord(int firstRow, int firstColumn)
- Returns:
- the shared ArrayRecord identified by (firstRow, firstColumn). never
null
.
-
-