Top Description Constructors Methods
org.apache.poi.hssf.model

pack-priv final Class RecordOrderer

extends Object
Class Inheritance
Imports
java.util.List, org.apache.poi.hssf.record.ArrayRecord, .BOFRecord, .BlankRecord, .BoolErrRecord, .CalcCountRecord, .CalcModeRecord, .ColumnInfoRecord, .DVALRecord, .DateWindow1904Record, .DefaultColWidthRecord, .DefaultRowHeightRecord, .DeltaRecord, .DimensionsRecord, .DrawingRecord, .DrawingSelectionRecord, .EOFRecord, .FeatRecord, .FormulaRecord, .GridsetRecord, .GutsRecord, .HyperlinkRecord, .IndexRecord, .IterationRecord, .LabelRecord, .LabelSSTRecord, .NumberRecord, .ObjRecord, .PaneRecord, .PrecisionRecord, .PrintGridlinesRecord, .PrintHeadersRecord, .RKRecord, .Record, .RecordBase, .RefModeRecord, .RowRecord, .SCLRecord, .SaveRecalcRecord, .SelectionRecord, .SharedFormulaRecord, .TableRecord, .TextObjectRecord, .UncalcedRecord, .UnknownRecord, .WindowOneRecord, .WindowTwoRecord, org.apache.poi.hssf.record.aggregates.ColumnInfoRecordsAggregate, .ConditionalFormattingTable, .DataValidityTable, .MergedCellsTable, .PageSettingsBlock, .WorksheetProtectionBlock, org.apache.poi.hssf.record.pivottable.ViewDefinitionRecord

Finds correct insert positions for records in workbook streams

See OOO excelfileformat.pdf sec. 4.2.5 'Record Order in a BIFF8 Workbook Stream'

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static void
addNewSheetRecord(List<RecordBase> sheetRecords, RecordBase newRecord)

Adds the specified new record in the correct place in sheet records list

private static int
findDataValidationTableInsertPos(List<RecordBase>
the records for this sheet + WINDOW2 o SCL o PANE oo SELECTION o STANDARDWIDTH oo MERGEDCELLS o LABELRANGES o PHONETICPR o Conditional Formatting Table o Hyperlink Table o Data Validity Table o SHEETLAYOUT o SHEETPROTECTION o RANGEPROTECTION + EOF
records
)

Finds the index where the sheet validations header record should be inserted

private static int
findInsertPosForNewCondFormatTable(List<RecordBase> records)

Find correct position to add new CFHeader record

private static int
private static int
findSheetInsertPos(List<RecordBase> records, Class<? extends RecordBase> recClass)

private static int
getDimensionsIndex(List<RecordBase> records)

DIMENSIONS record is always present

private static int
private static int
private static int
getWorksheetProtectionBlockInsertPos(List<RecordBase>
the records for this sheet
+ BOF
o INDEX
o Calculation Settings Block
o PRINTHEADERS
o PRINTGRIDLINES
o GRIDSET
o GUTS
o DEFAULTROWHEIGHT
o SHEETPR
o Page Settings Block
o Worksheet Protection Block
o DEFCOLWIDTH
oo COLINFO
o SORT
+ DIMENSION
records
)

Finds the index where the protection block should be inserted

private static boolean
private static boolean
public static boolean

Returns:

true if the specified record ID terminates a sequence of Row block records It is assumed that at least one row or cell value record has been found prior to the current record
isEndOfRowBlock
(int sid)

private static boolean
private static boolean
private static boolean
isProtectionSubsequentRecord(Object rb)

These records may occur between the 'Worksheet Protection Block' and DIMENSION:

o DEFCOLWIDTH
oo COLINFO
o SORT
public static boolean

Returns:

true if the specified record id normally appears in the row blocks section of the sheet records
isRowBlockRecord
(int sid)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

RecordOrdererback to summary
private RecordOrderer()

Method Detail

addNewSheetRecordback to summary
public static void addNewSheetRecord(List<RecordBase> sheetRecords, RecordBase newRecord)

Adds the specified new record in the correct place in sheet records list

findDataValidationTableInsertPosback to summary
private static int findDataValidationTableInsertPos(List<RecordBase> records)

Finds the index where the sheet validations header record should be inserted

Parameters
records:List<RecordBase>

the records for this sheet + WINDOW2 o SCL o PANE oo SELECTION o STANDARDWIDTH oo MERGEDCELLS o LABELRANGES o PHONETICPR o Conditional Formatting Table o Hyperlink Table o Data Validity Table o SHEETLAYOUT o SHEETPROTECTION o RANGEPROTECTION + EOF

findInsertPosForNewCondFormatTableback to summary
private static int findInsertPosForNewCondFormatTable(List<RecordBase> records)

Find correct position to add new CFHeader record

findInsertPosForNewMergedRecordTableback to summary
private static int findInsertPosForNewMergedRecordTable(List<RecordBase> records)
findSheetInsertPosback to summary
private static int findSheetInsertPos(List<RecordBase> records, Class<? extends RecordBase> recClass)
getDimensionsIndexback to summary
private static int getDimensionsIndex(List<RecordBase> records)

DIMENSIONS record is always present

getGutsRecordInsertPosback to summary
private static int getGutsRecordInsertPos(List<RecordBase> records)
getPageBreakRecordInsertPosback to summary
private static int getPageBreakRecordInsertPos(List<RecordBase> records)
getWorksheetProtectionBlockInsertPosback to summary
private static int getWorksheetProtectionBlockInsertPos(List<RecordBase> records)

Finds the index where the protection block should be inserted

Parameters
records:List<RecordBase>

the records for this sheet

+ BOF
o INDEX
o Calculation Settings Block
o PRINTHEADERS
o PRINTGRIDLINES
o GRIDSET
o GUTS
o DEFAULTROWHEIGHT
o SHEETPR
o Page Settings Block
o Worksheet Protection Block
o DEFCOLWIDTH
oo COLINFO
o SORT
+ DIMENSION
isDVTPriorRecordback to summary
private static boolean isDVTPriorRecord(RecordBase rb)
isDVTSubsequentRecordback to summary
private static boolean isDVTSubsequentRecord(short sid)
isEndOfRowBlockback to summary
public static boolean isEndOfRowBlock(int sid)
Returns:boolean

true if the specified record ID terminates a sequence of Row block records It is assumed that at least one row or cell value record has been found prior to the current record

isGutsPriorRecordback to summary
private static boolean isGutsPriorRecord(RecordBase rb)
isPageBreakPriorRecordback to summary
private static boolean isPageBreakPriorRecord(Object rb)
isProtectionSubsequentRecordback to summary
private static boolean isProtectionSubsequentRecord(Object rb)

These records may occur between the 'Worksheet Protection Block' and DIMENSION:

o DEFCOLWIDTH
oo COLINFO
o SORT
isRowBlockRecordback to summary
public static boolean isRowBlockRecord(int sid)
Returns:boolean

true if the specified record id normally appears in the row blocks section of the sheet records