Package org.apache.poi.ss.util
Class CellRangeAddressList
java.lang.Object
org.apache.poi.ss.util.CellRangeAddressList
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.
- Author:
- Dragos Buleandra (dragos.buleandra@trade2b.ro)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final List<CellRangeAddress>List of CellRangeAddresses. -
Constructor Summary
ConstructorsConstructorDescriptionCellRangeAddressList(int firstRow, int lastRow, int firstCol, int lastCol) Convenience constructor for creating a CellRangeAddressList with a single CellRangeAddress. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCellRangeAddress(int firstRow, int firstCol, int lastRow, int lastCol) Add a cell range structure.voidcopy()intGet the number of following ADDR structures.getCellRangeAddress(int index) static intgetEncodedSize(int numberOfRanges) intgetSize()remove(int rangeIndex) intserialize(int offset, byte[] data) void
-
Field Details
-
_list
List of CellRangeAddresses. Each structure represents a cell range
-
-
Constructor Details
-
CellRangeAddressList
public CellRangeAddressList() -
CellRangeAddressList
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. -
CellRangeAddressList
- Parameters:
in- the RecordInputstream to read the record from
-
-
Method Details
-
countRanges
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:
- number of ADDR structures
-
addCellRangeAddress
public void addCellRangeAddress(int firstRow, int firstCol, int lastRow, int lastCol) Add a cell range structure.- Parameters:
firstRow- - the upper left hand corner's rowfirstCol- - the upper left hand corner's collastRow- - the lower right hand corner's rowlastCol- - the lower right hand corner's col
-
addCellRangeAddress
-
remove
-
getCellRangeAddress
- Returns:
- CellRangeAddress at the given index
-
getSize
public int getSize() -
getEncodedSize
public static int getEncodedSize(int numberOfRanges) - Returns:
- the total size of for the specified number of ranges, including the initial 2 byte range count
-
serialize
public int serialize(int offset, byte[] data) -
serialize
-
copy
-
getCellRangeAddresses
-