public class HSSFRow extends Object implements Comparable
Modifier and Type | Class and Description |
---|---|
private class |
HSSFRow.CellIterator |
Modifier and Type | Field and Description |
---|---|
private Workbook |
book
reference to containing low level Workbook
|
private HSSFCell[] |
cells |
static int |
INITIAL_CAPACITY |
private RowRecord |
row
reference to low level representation
|
private int |
rowNum |
private Sheet |
sheet
reference to containing Sheet
|
Modifier | Constructor and Description |
---|---|
protected |
HSSFRow() |
protected |
HSSFRow(Workbook book,
Sheet sheet,
int rowNum)
Creates new HSSFRow from scratch.
|
protected |
HSSFRow(Workbook book,
Sheet sheet,
RowRecord record)
Creates an HSSFRow from a low level RowRecord object.
|
Modifier and Type | Method and Description |
---|---|
private void |
addCell(HSSFCell cell)
used internally to add a cell.
|
Iterator |
cellIterator() |
int |
compareTo(Object obj) |
HSSFCell |
createCell(short column)
Use this to create new cells within the row and return it.
|
HSSFCell |
createCell(short column,
int type)
Use this to create new cells within the row and return it.
|
protected HSSFCell |
createCellFromRecord(CellValueRecordInterface cell)
create a high level HSSFCell object from an existing low level record.
|
boolean |
equals(Object obj) |
private short |
findFirstCell(short firstcell)
used internally to refresh the "first cell" when the first cell is removed.
|
private short |
findLastCell(short lastcell)
used internally to refresh the "last cell" when the last cell is removed.
|
HSSFCell |
getCell(short cellnum)
get the hssfcell representing a given column (logical cell) 0-based.
|
short |
getFirstCellNum()
get the number of the first cell contained in this row.
|
short |
getHeight()
get the row's height or ff (-1) for undefined/default-height in twips (1/20th of a point)
|
float |
getHeightInPoints()
get the row's height or ff (-1) for undefined/default-height in points (20*getHeight())
|
short |
getLastCellNum()
gets the number of the last cell contained in this row PLUS ONE.
|
int |
getPhysicalNumberOfCells()
gets the number of defined cells (NOT number of cells in the actual row!).
|
int |
getRowNum()
get row number this row represents
|
protected RowRecord |
getRowRecord()
get the lowlevel RowRecord represented by this object - should only be called
by other parts of the high level API
|
boolean |
getZeroHeight()
get whether or not to display this row with 0 height
|
void |
removeCell(HSSFCell cell)
remove the HSSFCell from this row.
|
void |
setHeight(short height)
set the row's height or set to ff (-1) for undefined/default-height.
|
void |
setHeightInPoints(float height)
set the row's height in points.
|
void |
setRowNum(int rowNum)
set the row number of this row.
|
void |
setZeroHeight(boolean zHeight)
set whether or not to display this row with 0 height
|
public static final int INITIAL_CAPACITY
private int rowNum
private HSSFCell[] cells
private RowRecord row
private Workbook book
private Sheet sheet
protected HSSFRow()
protected HSSFRow(Workbook book, Sheet sheet, int rowNum)
book
- low-level Workbook object containing the sheet that contains this rowsheet
- low-level Sheet object that contains this RowrowNum
- the row number of this row (0 based)HSSFSheet.createRow(int)
protected HSSFRow(Workbook book, Sheet sheet, RowRecord record)
book
- low-level Workbook object containing the sheet that contains this rowsheet
- low-level Sheet object that contains this Rowrecord
- the low level api object this row should representHSSFSheet.createRow(int)
public HSSFCell createCell(short column)
The cell that is returned is a CELL_TYPE_BLANK. The type can be changed
either through calling setCellValue
or setCellType
.
column
- - the column number this cell representspublic HSSFCell createCell(short column, int type)
The cell that is returned is a CELL_TYPE_BLANK. The type can be changed either through calling setCellValue or setCellType.
column
- - the column number this cell representspublic void removeCell(HSSFCell cell)
cell
- to removeprotected HSSFCell createCellFromRecord(CellValueRecordInterface cell)
cell
- low level cell to create the high level representation frompublic void setRowNum(int rowNum)
rowNum
- the row number (0-based)IndexOutOfBoundsException
- if the row number is not within the range 0-65535.public int getRowNum()
private void addCell(HSSFCell cell)
public HSSFCell getCell(short cellnum)
cellnum
- 0 based column numberpublic short getFirstCellNum()
public short getLastCellNum()
public int getPhysicalNumberOfCells()
public void setHeight(short height)
height
- rowheight or 0xff for undefined (use sheet default)public void setZeroHeight(boolean zHeight)
zHeight
- height is zero or not.public boolean getZeroHeight()
public void setHeightInPoints(float height)
height
- row height in pointspublic short getHeight()
public float getHeightInPoints()
protected RowRecord getRowRecord()
private short findLastCell(short lastcell)
private short findFirstCell(short firstcell)
public Iterator cellIterator()
public int compareTo(Object obj)
compareTo
in interface Comparable
Copyright © 2015 Open Microscopy Environment