Class CFRecordsAggregate
- java.lang.Object
-
- org.apache.poi.hssf.record.RecordBase
-
- org.apache.poi.hssf.record.aggregates.RecordAggregate
-
- org.apache.poi.hssf.record.aggregates.CFRecordsAggregate
-
- All Implemented Interfaces:
GenericRecord
public final class CFRecordsAggregate extends RecordAggregate implements GenericRecord
CFRecordsAggregate - aggregates Conditional Formatting records CFHeaderRecord and number of up CFRuleRecord records together to simplify access to them.
Note that Excel versions before 2007 can only cope with a maximum of 3 Conditional Formatting rules per sheet. Excel 2007 or newer can cope with unlimited numbers, as can Apache OpenOffice. This is an Excel limitation, not a file format one.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.poi.hssf.record.aggregates.RecordAggregate
RecordAggregate.PositionTrackingVisitor, RecordAggregate.RecordVisitor
-
-
Constructor Summary
Constructors Constructor Description CFRecordsAggregate(CFRecordsAggregate other)
CFRecordsAggregate(CellRangeAddress[] regions, CFRuleBase[] rules)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addRule(CFRuleBase r)
CFRecordsAggregate
cloneCFAggregate()
Create a deep clone of the recordstatic CFRecordsAggregate
createCFAggregate(RecordStream rs)
Create CFRecordsAggregate from a list of CF RecordsMap<String,Supplier<?>>
getGenericProperties()
CFHeaderBase
getHeader()
int
getNumberOfRules()
CFRuleBase
getRule(int idx)
void
setRule(int idx, CFRuleBase r)
String
toString()
String representation of CFRecordsAggregateboolean
updateFormulasAfterCellShift(FormulaShifter shifter, int currentExternSheetIx)
void
visitContainedRecords(RecordAggregate.RecordVisitor rv)
Visit each of the atomic BIFF records contained in this RecordAggregate in the order that they should be written to file.-
Methods inherited from class org.apache.poi.hssf.record.aggregates.RecordAggregate
getRecordSize, serialize
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.poi.common.usermodel.GenericRecord
getGenericChildren, getGenericRecordType
-
-
-
-
Constructor Detail
-
CFRecordsAggregate
public CFRecordsAggregate(CFRecordsAggregate other)
-
CFRecordsAggregate
public CFRecordsAggregate(CellRangeAddress[] regions, CFRuleBase[] rules)
-
-
Method Detail
-
createCFAggregate
public static CFRecordsAggregate createCFAggregate(RecordStream rs)
Create CFRecordsAggregate from a list of CF Records- Parameters:
rs
- - the stream to read from- Returns:
- CFRecordsAggregate object
-
cloneCFAggregate
public CFRecordsAggregate cloneCFAggregate()
Create a deep clone of the record- Returns:
- A new object with the same values as this record
-
getHeader
public CFHeaderBase getHeader()
- Returns:
- the header. Never
null
.
-
getRule
public CFRuleBase getRule(int idx)
-
setRule
public void setRule(int idx, CFRuleBase r)
-
addRule
public void addRule(CFRuleBase r)
-
getNumberOfRules
public int getNumberOfRules()
-
getGenericProperties
public Map<String,Supplier<?>> getGenericProperties()
- Specified by:
getGenericProperties
in interfaceGenericRecord
-
toString
public String toString()
String representation of CFRecordsAggregate
-
visitContainedRecords
public void visitContainedRecords(RecordAggregate.RecordVisitor rv)
Description copied from class:RecordAggregate
Visit each of the atomic BIFF records contained in this RecordAggregate in the order that they should be written to file. Implementors may or may not return the actualRecord
s being used to manage POI's internal implementation. Callers should not assume either way, and therefore only attempt to modify thoseRecord
s after cloning- Specified by:
visitContainedRecords
in classRecordAggregate
- Parameters:
rv
- The visitor to use for callbacks while walking this object
-
updateFormulasAfterCellShift
public boolean updateFormulasAfterCellShift(FormulaShifter shifter, int currentExternSheetIx)
- Parameters:
shifter
- TheFormulaShifter
to usecurrentExternSheetIx
- The index for extern sheets- Returns:
false
if this wholeCFHeaderRecord
/CFRuleRecord
s should be deleted
-
-