Class SharedValueManager
java.lang.Object
org.apache.poi.hssf.record.aggregates.SharedValueManager
Manages various auxiliary records while constructing a
RowRecordsAggregate:
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdd specified Array Record.static SharedValueManagercreate(SharedFormulaRecord[] sharedFormulaRecords, CellReference[] firstCells, ArrayRecord[] arrayRecords, TableRecord[] tableRecords) static SharedValueManagergetArrayRecord(int firstRow, int firstColumn) static intGets theSharedValueRecordBaserecord if it should be encoded immediately after the formula record contained in the specifiedFormulaRecordAggregateagg.linkSharedFormulaRecord(CellReference firstCell, FormulaRecordAggregate agg) removeArrayFormula(int rowIndex, int columnIndex) Removes theArrayRecordfor the cell group containing the specified cell.static voidsetMaxNumberOfFormulaRecordAggregates(int maxNumberOfFormulaRecordAggregates) voidunlink(SharedFormulaRecord sharedFormulaRecord) Converts allFormulaRecords handled bysharedFormulaRecordto plain unshared formulas
-
Method Details
-
setMaxNumberOfFormulaRecordAggregates
public static void setMaxNumberOfFormulaRecordAggregates(int maxNumberOfFormulaRecordAggregates) -
getMaxNumberOfFormulaRecordAggregates
public static int getMaxNumberOfFormulaRecordAggregates() -
createEmpty
- Returns:
- a new empty SharedValueManager.
-
getRecordForFirstCell
Gets theSharedValueRecordBaserecord if it should be encoded immediately after the formula record contained in the specifiedFormulaRecordAggregateagg. 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.
nullif the formula cell is not shared/array/table, or if the specified formula is not the first in the group.
-
addArrayRecord
Add specified Array Record. An existing record for exactly the same range is replaced, as re-entering an array formula over its range does in Excel. -
removeArrayFormula
Removes theArrayRecordfor 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
- Returns:
- the shared ArrayRecord identified by (firstRow, firstColumn). never
null.
-