Top Description Fields Constructors Methods
org.apache.poi.hssf.record.aggregates

public final Class CFRecordsAggregate

extends RecordAggregate
implements GenericRecord
Class Inheritance
All Implemented Interfaces
org.apache.poi.common.usermodel.GenericRecord
Imports
java.util.ArrayList, .List, .Map, java.util.function.Supplier, org.apache.logging.log4j.LogManager, .Logger, org.apache.poi.common.usermodel.GenericRecord, org.apache.poi.hssf.model.RecordStream, org.apache.poi.hssf.record.CFHeader12Record, .CFHeaderBase, .CFHeaderRecord, .CFRule12Record, .CFRuleBase, .CFRuleRecord, .Record, org.apache.poi.ss.formula.FormulaShifter, org.apache.poi.ss.formula.ptg.Ptg, org.apache.poi.ss.usermodel.helpers.BaseRowColShifter, org.apache.poi.ss.util.CellRangeAddress, org.apache.poi.util.GenericRecordJsonWriter, .GenericRecordUtil, .RecordFormatException

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.

Field Summary

Modifier and TypeField and Description
private final CFHeaderBase
private static final Logger
private static final int
MAX_97_2003_CONDTIONAL_FORMAT_RULES

Excel 97-2003 allows up to 3 conditional formating rules

private final List<CFRuleBase>
rules

List of CFRuleRecord objects

Constructor Summary

AccessConstructor and Description
public
private
public

Method Summary

Modifier and TypeMethod and Description
public void
private void
checkRuleIndex(int idx)

private void
public CFRecordsAggregate

Returns:

A new object with the same values as this record
cloneCFAggregate
()

Create a deep clone of the record

public static CFRecordsAggregate

Returns:

CFRecordsAggregate object
createCFAggregate
(RecordStream
- the stream to read from
rs
)

Create CFRecordsAggregate from a list of CF Records

private static CFHeaderBase
public Map<String, Supplier<?>>
public CFHeaderBase

Returns:

the header. Never null.
getHeader
()

public int
public CFRuleBase
getRule(int idx)

public void
setRule(int idx, CFRuleBase r)

public String
toString()

Overrides java.lang.Object.toString.

String representation of CFRecordsAggregate

public boolean

Returns:

false if this whole CFHeaderRecord / CFRuleRecords should be deleted
updateFormulasAfterCellShift
(FormulaShifter
The FormulaShifter to use
shifter
,
int
The index for extern sheets
currentExternSheetIx
)

public void
visitContainedRecords(RecordAggregate.RecordVisitor
The visitor to use for callbacks while walking this object
rv
)

Implements abstract org.apache.poi.hssf.record.aggregates.RecordAggregate.visitContainedRecords.

Visit each of the atomic BIFF records contained in this RecordAggregate in the order that they should be written to file.

Inherited from org.apache.poi.hssf.record.aggregates.RecordAggregate:
getRecordSizeserialize

Field Detail

LOGback to summary
private static final Logger LOG
MAX_97_2003_CONDTIONAL_FORMAT_RULESback to summary
private static final int MAX_97_2003_CONDTIONAL_FORMAT_RULES

Excel 97-2003 allows up to 3 conditional formating rules

rulesback to summary
private final List<CFRuleBase> rules

List of CFRuleRecord objects

Constructor Detail

CFRecordsAggregateback to summary
public CFRecordsAggregate(CFRecordsAggregate other)
CFRecordsAggregateback to summary
private CFRecordsAggregate(CFHeaderBase pHeader, CFRuleBase[] pRules)
CFRecordsAggregateback to summary
public CFRecordsAggregate(CellRangeAddress[] regions, CFRuleBase[] rules)

Method Detail

addRuleback to summary
public void addRule(CFRuleBase r)
checkRuleIndexback to summary
private void checkRuleIndex(int idx)
checkRuleTypeback to summary
private void checkRuleType(CFRuleBase r)
cloneCFAggregateback to summary
public CFRecordsAggregate cloneCFAggregate()

Create a deep clone of the record

Returns:CFRecordsAggregate

A new object with the same values as this record

createCFAggregateback to summary
public static CFRecordsAggregate createCFAggregate(RecordStream rs)

Create CFRecordsAggregate from a list of CF Records

Parameters
rs:RecordStream

- the stream to read from

Returns:CFRecordsAggregate

CFRecordsAggregate object

createHeaderback to summary
private static CFHeaderBase createHeader(CellRangeAddress[] regions, CFRuleBase[] rules)
getGenericPropertiesback to summary
public Map<String, Supplier<?>> getGenericProperties()

Implements org.apache.poi.common.usermodel.GenericRecord.getGenericProperties.

Annotations
@Override
getHeaderback to summary
public CFHeaderBase getHeader()
Returns:CFHeaderBase

the header. Never null.

getNumberOfRulesback to summary
public int getNumberOfRules()
getRuleback to summary
public CFRuleBase getRule(int idx)
setRuleback to summary
public void setRule(int idx, CFRuleBase r)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

String representation of CFRecordsAggregate

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object

updateFormulasAfterCellShiftback to summary
public boolean updateFormulasAfterCellShift(FormulaShifter shifter, int currentExternSheetIx)
Parameters
shifter:FormulaShifter

The FormulaShifter to use

currentExternSheetIx:int

The index for extern sheets

Returns:boolean

false if this whole CFHeaderRecord / CFRuleRecords should be deleted

visitContainedRecordsback to summary
public void visitContainedRecords(RecordAggregate.RecordVisitor rv)

Implements abstract org.apache.poi.hssf.record.aggregates.RecordAggregate.visitContainedRecords.

Doc from org.apache.poi.hssf.record.aggregates.RecordAggregate.visitContainedRecords.

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 actual Records being used to manage POI's internal implementation. Callers should not assume either way, and therefore only attempt to modify those Records after cloning

Parameters
rv:RecordAggregate.RecordVisitor

The visitor to use for callbacks while walking this object

Annotations
@Override