org.apache.poi.hssf.record.aggregates
Class SharedValueManager

java.lang.Object
  extended by org.apache.poi.hssf.record.aggregates.SharedValueManager

public final class SharedValueManager
extends java.lang.Object

Manages various auxiliary records while constructing a RowRecordsAggregate:

Author:
Josh Micich

Field Summary
static SharedValueManager EMPTY
           
 
Method Summary
static SharedValueManager create(SharedFormulaRecord[] sharedFormulaRecords, ArrayRecord[] arrayRecords, TableRecord[] tableRecords)
           
 SharedValueRecordBase getRecordForFirstCell(CellReference firstCell, FormulaRecordAggregate agg)
          The SharedValueRecordBase record returned by this method
 SharedFormulaRecord linkSharedFormulaRecord(CellReference firstCell, FormulaRecordAggregate agg)
           
 void unlink(SharedFormulaRecord sharedFormulaRecord)
          Converts all FormulaRecords handled by sharedFormulaRecord to plain unshared formulas
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY

public static final SharedValueManager EMPTY
Method Detail

create

public static SharedValueManager create(SharedFormulaRecord[] sharedFormulaRecords,
                                        ArrayRecord[] arrayRecords,
                                        TableRecord[] tableRecords)
Parameters:
recs - list of sheet records (possibly contains records for other parts of the Excel file)
startIx - index of first row/cell record for current sheet
endIx - one past index of last row/cell record for current sheet. It is important that this code does not inadvertently collect SharedFormulaRecords from any other sheet (which could happen if endIx is chosen poorly). (see bug 44449)

linkSharedFormulaRecord

public SharedFormulaRecord linkSharedFormulaRecord(CellReference firstCell,
                                                   FormulaRecordAggregate agg)
Parameters:
firstCell - as extracted from the ExpPtg from the cell's formula.
Returns:
never null

getRecordForFirstCell

public SharedValueRecordBase getRecordForFirstCell(CellReference firstCell,
                                                   FormulaRecordAggregate agg)
The SharedValueRecordBase record returned by this method

Parameters:
firstCell - the cell coordinates as read from the ExpPtg or TblPtg of the current formula. Note - this is usually not the same as the cell coordinates of the formula's cell.
Returns:
the SHRFMLA, TABLE or ARRAY record for this formula cell, if it is the first cell of a table or array region. null if

unlink

public void unlink(SharedFormulaRecord sharedFormulaRecord)
Converts all FormulaRecords handled by sharedFormulaRecord to plain unshared formulas



Copyright 2008 The Apache Software Foundation or its licensors, as applicable.