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

public final Class MergeCellsRecord

extends StandardRecord
Class Inheritance
Imports
java.util.Arrays, .Map, java.util.function.Supplier, java.util.stream.Stream, org.apache.poi.ss.util.CellRangeAddress, .CellRangeAddressList, org.apache.poi.util.GenericRecordUtil, .LittleEndianOutput

Optional record defining a square area of cells to "merged" into one cell.

Field Summary

Modifier and TypeField and Description
private final int
private final CellRangeAddress[]
_regions

sometimes the regions array is shared with other MergedCellsRecords

private final int
public static final short

Constructor Summary

AccessConstructor and Description
public
public
MergeCellsRecord(CellRangeAddress[] regions, int startIndex, int numberOfRegions)

public
MergeCellsRecord(RecordInputStream
the RecordInputstream to read the record from
in
)

Constructs a MergedCellsRecord and sets its fields appropriately

Method Summary

Modifier and TypeMethod and Description
public MergeCellsRecord
public CellRangeAddress

Returns:

MergedRegion at the given index representing the area that is Merged (r1,c1 - r2,c2)
getAreaAt
(int
the n-th MergedRegion
index
)

protected int
public Map<String, Supplier<?>>
public HSSFRecordTypes
public short

Returns:

number of areas
getNumAreas
()

get the number of merged areas.

public short
getSid()

Implements abstract org.apache.poi.hssf.record.Record.getSid.

return the non static version of the id for this record.

public void
serialize(LittleEndianOutput
the output object
out
)

Implements abstract org.apache.poi.hssf.record.StandardRecord.serialize.

Write the data content of this BIFF record.

Inherited from org.apache.poi.hssf.record.StandardRecord:
getRecordSizeserialize

Field Detail

_numberOfRegionsback to summary
private final int _numberOfRegions
_regionsback to summary
private final CellRangeAddress[] _regions

sometimes the regions array is shared with other MergedCellsRecords

_startIndexback to summary
private final int _startIndex
sidback to summary
public static final short sid

Constructor Detail

MergeCellsRecordback to summary
public MergeCellsRecord(MergeCellsRecord other)
MergeCellsRecordback to summary
public MergeCellsRecord(CellRangeAddress[] regions, int startIndex, int numberOfRegions)
MergeCellsRecordback to summary
public MergeCellsRecord(RecordInputStream in)

Constructs a MergedCellsRecord and sets its fields appropriately

Parameters
in:RecordInputStream

the RecordInputstream to read the record from

Method Detail

copyback to summary
public MergeCellsRecord copy()

Implements abstract org.apache.poi.hssf.record.StandardRecord.copy.

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

Returns:MergeCellsRecord

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

a deep copy of the implementing class / instance

Annotations
@Override
getAreaAtback to summary
public CellRangeAddress getAreaAt(int index)
Parameters
index:int

the n-th MergedRegion

Returns:CellRangeAddress

MergedRegion at the given index representing the area that is Merged (r1,c1 - r2,c2)

getDataSizeback to summary
protected int getDataSize()

Implements abstract org.apache.poi.hssf.record.StandardRecord.getDataSize.

Annotations
@Override
getGenericPropertiesback to summary
public Map<String, Supplier<?>> getGenericProperties()

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

Annotations
@Override
getGenericRecordTypeback to summary
public HSSFRecordTypes getGenericRecordType()

Overrides default org.apache.poi.common.usermodel.GenericRecord.getGenericRecordType.

Implements abstract org.apache.poi.hssf.record.Record.getGenericRecordType.

Annotations
@Override
getNumAreasback to summary
public short getNumAreas()

get the number of merged areas. If this drops down to 0 you should just go ahead and delete the record.

Returns:short

number of areas

getSidback to summary
public short getSid()

Implements abstract org.apache.poi.hssf.record.Record.getSid.

Doc from org.apache.poi.hssf.record.Record.getSid.

return the non static version of the id for this record.

Returns:short

he id for this record

Annotations
@Override
serializeback to summary
public void serialize(LittleEndianOutput out)

Implements abstract org.apache.poi.hssf.record.StandardRecord.serialize.

Doc from org.apache.poi.hssf.record.StandardRecord.serialize.

Write the data content of this BIFF record. The 'ushort sid' and 'ushort size' header fields have already been written by the superclass.

The number of bytes written must equal the record size reported by org.apache.poi.hssf.record.Record#getRecordSize()} minus four ( record header consisting of a 'ushort sid' and 'ushort reclength' has already been written by their superclass).

Parameters
out:LittleEndianOutput

the output object

Annotations
@Override