Top Description Fields Constructors Methods
org.apache.poi.ss.util

public Class CellRangeAddressList

extends Object
implements GenericRecord
Class Inheritance
All Implemented Interfaces
org.apache.poi.common.usermodel.GenericRecord
Imports
java.io.IOException, java.util.ArrayList, .List, .Map, java.util.function.Supplier, org.apache.poi.common.usermodel.GenericRecord, org.apache.poi.hssf.record.RecordInputStream, org.apache.poi.util.LittleEndianByteArrayOutputStream, .LittleEndianOutput

Implementation of the cell range address lists,like is described in OpenOffice.org's Excel Documentation: excelfileformat.pdf sec 2.5.14 - 'Cell Range Address List' In BIFF8 there is a common way to store absolute cell range address lists in several records (not formulas). A cell range address list consists of a field with the number of ranges and the list of the range addresses. Each cell range address (called an ADDR structure) contains 4 16-bit-values.

Field Summary

Modifier and TypeField and Description
protected final List<CellRangeAddress>
_list

List of CellRangeAddresses.

Constructor Summary

AccessConstructor and Description
public
public
CellRangeAddressList(int firstRow, int lastRow, int firstCol, int lastCol)

Convenience constructor for creating a CellRangeAddressList with a single CellRangeAddress.

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

Method Summary

Modifier and TypeMethod and Description
public void
addCellRangeAddress(int
- the upper left hand corner's row
firstRow
,
int
- the upper left hand corner's col
firstCol
,
int
- the lower right hand corner's row
lastRow
,
int
- the lower right hand corner's col
lastCol
)

Add a cell range structure.

public void
public CellRangeAddressList
copy()

public int

Returns:

number of ADDR structures
countRanges
()

Get the number of following ADDR structures.

public CellRangeAddress

Returns:

CellRangeAddress at the given index
getCellRangeAddress
(int index)

public CellRangeAddress[]
public static int

Returns:

the total size of for the specified number of ranges, including the initial 2 byte range count
getEncodedSize
(int numberOfRanges)

public List<CellRangeAddress>
public Map<String, Supplier<?>>
public int
public CellRangeAddress
remove(int rangeIndex)

public int
serialize(int offset, byte[] data)

public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_listback to summary
protected final List<CellRangeAddress> _list

List of CellRangeAddresses. Each structure represents a cell range

Constructor Detail

CellRangeAddressListback to summary
public CellRangeAddressList()
CellRangeAddressListback to summary
public CellRangeAddressList(int firstRow, int lastRow, int firstCol, int lastCol)

Convenience constructor for creating a CellRangeAddressList with a single CellRangeAddress. Other CellRangeAddresses may be added later.

CellRangeAddressListback to summary
public CellRangeAddressList(RecordInputStream in)
Parameters
in:RecordInputStream

the RecordInputstream to read the record from

Method Detail

addCellRangeAddressback to summary
public void addCellRangeAddress(int firstRow, int firstCol, int lastRow, int lastCol)

Add a cell range structure.

Parameters
firstRow:int

- the upper left hand corner's row

firstCol:int

- the upper left hand corner's col

lastRow:int

- the lower right hand corner's row

lastCol:int

- the lower right hand corner's col

addCellRangeAddressback to summary
public void addCellRangeAddress(CellRangeAddress cra)
copyback to summary
public CellRangeAddressList copy()
countRangesback to summary
public int countRanges()

Get the number of following ADDR structures. The number of this structures is automatically set when reading an Excel file and/or increased when you manually add a new ADDR structure . This is the reason there isn't a set method for this field .

Returns:int

number of ADDR structures

getCellRangeAddressback to summary
public CellRangeAddress getCellRangeAddress(int index)
Returns:CellRangeAddress

CellRangeAddress at the given index

getCellRangeAddressesback to summary
public CellRangeAddress[] getCellRangeAddresses()
getEncodedSizeback to summary
public static int getEncodedSize(int numberOfRanges)
Returns:int

the total size of for the specified number of ranges, including the initial 2 byte range count

getGenericChildrenback to summary
public List<CellRangeAddress> getGenericChildren()

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

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

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

Annotations
@Override
getSizeback to summary
public int getSize()
removeback to summary
public CellRangeAddress remove(int rangeIndex)
serializeback to summary
public int serialize(int offset, byte[] data)
serializeback to summary
public void serialize(LittleEndianOutput out)