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

public final Class ColumnInfoRecordsAggregate

extends RecordAggregate
implements Duplicatable
Class Inheritance
All Implemented Interfaces
org.apache.poi.common.Duplicatable
Imports
java.util.ArrayList, .List, org.apache.poi.common.Duplicatable, org.apache.poi.hssf.model.RecordStream, org.apache.poi.hssf.record.ColumnInfoRecord

Field Summary

Modifier and TypeField and Description
private final List<ColumnInfoRecord>
records

List of ColumnInfoRecords assumed to be in order

Constructor Summary

AccessConstructor and Description
public
ColumnInfoRecordsAggregate()

Creates an empty aggregate

public
public

Method Summary

Modifier and TypeMethod and Description
private void
attemptMergeColInfoRecords(int colInfoIx)

Attempts to merge the col info record at the specified index with either or both of its neighbours

public void
collapseColumn(int columnIndex)

private static int
public ColumnInfoRecordsAggregate
private static ColumnInfoRecord
public void
expandColumn(int columnIndex)

private int
findColInfoIdx(int columnIx, int fromColInfoIdx)

public ColumnInfoRecord

Returns:

null if no column info found for the specified column
findColumnInfo
(int
index of the column (not the index of the ColumnInfoRecord)
columnIndex
)

Finds the ColumnInfoRecord which contains the specified columnIndex

private int
findEndOfColumnOutlineGroup(int colInfoIndex)

private int
private ColumnInfoRecord
getColInfo(int idx)

public int
public int
public int
pack-priv int
public int
getOutlineLevel(int columnIndex)

public void
groupColumnRange(int
group from this column (inclusive)
fromColumnIx
,
int
group to this column (inclusive)
toColumnIx
,
boolean
if true the group will be indented by one level, if false indenting will be decreased by one level.
indent
)

Creates an outline group for the specified columns, by setting the level field for each col info record in the range.

public void
insertColumn(ColumnInfoRecord col)

Inserts a column into the aggregate (at the end of the list).

private void
insertColumn(int idx, ColumnInfoRecord col)

Inserts a column into the aggregate (at the position specified by idx.

private boolean

Returns:

true, if the column is collapsed, false otherwise.
isColumnGroupCollapsed
(int idx)

'Collapsed' state is stored in a single column col info record immediately after the outline group

private boolean
private static boolean

Returns:

false if the two column records could not be merged
mergeColInfoRecords
(ColumnInfoRecord ciA, ColumnInfoRecord ciB)

merges two column info records (if they are adjacent and have the same formatting, etc)

public void
setColumn(int targetColumnIx, Short xfIndex, Integer width, Integer level, Boolean hidden, Boolean collapsed)

private static void
setColumnInfoFields(ColumnInfoRecord ci, Short xfStyle, Integer width, Integer level, Boolean hidden, Boolean collapsed)

Sets all non null fields into the ci parameter.

private int

Returns:

the column index of the last column in the outline group
setGroupHidden
(int
the col info index of the start of the outline group
pIdx
,
int level, boolean hidden)

Sets all adjacent columns of the same outline level to the specified hidden status.

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

recordsback to summary
private final List<ColumnInfoRecord> records

List of ColumnInfoRecords assumed to be in order

Constructor Detail

ColumnInfoRecordsAggregateback to summary
public ColumnInfoRecordsAggregate()

Creates an empty aggregate

ColumnInfoRecordsAggregateback to summary
public ColumnInfoRecordsAggregate(ColumnInfoRecordsAggregate other)
ColumnInfoRecordsAggregateback to summary
public ColumnInfoRecordsAggregate(RecordStream rs)

Method Detail

attemptMergeColInfoRecordsback to summary
private void attemptMergeColInfoRecords(int colInfoIx)

Attempts to merge the col info record at the specified index with either or both of its neighbours

collapseColumnback to summary
public void collapseColumn(int columnIndex)
compareColInfosback to summary
private static int compareColInfos(ColumnInfoRecord a, ColumnInfoRecord b)
copyback to summary
public ColumnInfoRecordsAggregate copy()

Implements org.apache.poi.common.Duplicatable.copy.

Returns:ColumnInfoRecordsAggregate

Doc from org.apache.poi.common.Duplicatable.copy.

a deep copy of the implementing class / instance

Annotations
@Override
copyColInfoback to summary
private static ColumnInfoRecord copyColInfo(ColumnInfoRecord ci)
expandColumnback to summary
public void expandColumn(int columnIndex)
findColInfoIdxback to summary
private int findColInfoIdx(int columnIx, int fromColInfoIdx)
findColumnInfoback to summary
public ColumnInfoRecord findColumnInfo(int columnIndex)

Finds the ColumnInfoRecord which contains the specified columnIndex

Parameters
columnIndex:int

index of the column (not the index of the ColumnInfoRecord)

Returns:ColumnInfoRecord

null if no column info found for the specified column

findEndOfColumnOutlineGroupback to summary
private int findEndOfColumnOutlineGroup(int colInfoIndex)
findStartOfColumnOutlineGroupback to summary
private int findStartOfColumnOutlineGroup(int pIdx)
getColInfoback to summary
private ColumnInfoRecord getColInfo(int idx)
getMaxColumnIndexback to summary
public int getMaxColumnIndex()
getMaxOutlineLevelback to summary
public int getMaxOutlineLevel()
getMinColumnIndexback to summary
public int getMinColumnIndex()
getNumColumnsback to summary
pack-priv int getNumColumns()
getOutlineLevelback to summary
public int getOutlineLevel(int columnIndex)
groupColumnRangeback to summary
public void groupColumnRange(int fromColumnIx, int toColumnIx, boolean indent)

Creates an outline group for the specified columns, by setting the level field for each col info record in the range. ColumnInfoRecords may be created, split or merged as a result of this operation.

Parameters
fromColumnIx:int

group from this column (inclusive)

toColumnIx:int

group to this column (inclusive)

indent:boolean

if true the group will be indented by one level, if false indenting will be decreased by one level.

insertColumnback to summary
public void insertColumn(ColumnInfoRecord col)

Inserts a column into the aggregate (at the end of the list).

insertColumnback to summary
private void insertColumn(int idx, ColumnInfoRecord col)

Inserts a column into the aggregate (at the position specified by idx.

isColumnGroupCollapsedback to summary
private boolean isColumnGroupCollapsed(int idx)

'Collapsed' state is stored in a single column col info record immediately after the outline group

Returns:boolean

true, if the column is collapsed, false otherwise.

isColumnGroupHiddenByParentback to summary
private boolean isColumnGroupHiddenByParent(int idx)
mergeColInfoRecordsback to summary
private static boolean mergeColInfoRecords(ColumnInfoRecord ciA, ColumnInfoRecord ciB)

merges two column info records (if they are adjacent and have the same formatting, etc)

Returns:boolean

false if the two column records could not be merged

setColumnback to summary
public void setColumn(int targetColumnIx, Short xfIndex, Integer width, Integer level, Boolean hidden, Boolean collapsed)
setColumnInfoFieldsback to summary
private static void setColumnInfoFields(ColumnInfoRecord ci, Short xfStyle, Integer width, Integer level, Boolean hidden, Boolean collapsed)

Sets all non null fields into the ci parameter.

setGroupHiddenback to summary
private int setGroupHidden(int pIdx, int level, boolean hidden)

Sets all adjacent columns of the same outline level to the specified hidden status.

Parameters
pIdx:int

the col info index of the start of the outline group

Returns:int

the column index of the last column in the outline group

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