|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.poi.hssf.usermodel.HSSFRow
public final class HSSFRow
High level representation of a row of a spreadsheet. Only rows that have cells should be added to a Sheet.
Nested Class Summary | |
---|---|
static class |
HSSFRow.MissingCellPolicy
Used to specify the different possible policies if for the case of null and blank cells |
Field Summary | |
---|---|
static HSSFRow.MissingCellPolicy |
CREATE_NULL_AS_BLANK
A new, blank cell is created for missing cells. |
static int |
INITIAL_CAPACITY
|
static HSSFRow.MissingCellPolicy |
RETURN_BLANK_AS_NULL
Missing cells are returned as null, as are blank cells |
static HSSFRow.MissingCellPolicy |
RETURN_NULL_AND_BLANK
Missing cells are returned as null, Blank cells are returned as normal |
Method Summary | |
---|---|
java.util.Iterator |
cellIterator()
|
int |
compareTo(java.lang.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(java.lang.Object obj)
|
HSSFCell |
getCell(int cellnum)
Get the hssfcell representing a given column (logical cell) 0-based. |
HSSFCell |
getCell(int cellnum,
HSSFRow.MissingCellPolicy policy)
Get the hssfcell representing a given column (logical cell) 0-based. |
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 index of the last cell contained in this row PLUS ONE. |
protected int |
getOutlineLevel()
Returns the rows outline level. |
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 |
java.util.Iterator |
iterator()
Alias for CellIterator to allow
foreach loops |
void |
moveCell(HSSFCell cell,
short newColumn)
Moves the supplied cell to a new column, which must not already have a cell there! |
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 |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int INITIAL_CAPACITY
public static final HSSFRow.MissingCellPolicy RETURN_NULL_AND_BLANK
public static final HSSFRow.MissingCellPolicy RETURN_BLANK_AS_NULL
public static final HSSFRow.MissingCellPolicy CREATE_NULL_AS_BLANK
Method Detail |
---|
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 represents
public 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 represents
public void removeCell(HSSFCell cell)
cell
- to removeprotected HSSFCell createCellFromRecord(CellValueRecordInterface cell)
cell
- low level cell to create the high level representation from
public void setRowNum(int rowNum)
rowNum
- the row number (0-based)
java.lang.IndexOutOfBoundsException
- if the row number is not within the range 0-65535.public int getRowNum()
protected int getOutlineLevel()
public void moveCell(HSSFCell cell, short newColumn)
cell
- The cell to movenewColumn
- The new column number (0 based)public HSSFCell getCell(short cellnum)
HSSFRow.MissingCellPolicy
on the base workbook.
Short method signature provided to retain binary
compatibility.
cellnum
- 0 based column number
public HSSFCell getCell(int cellnum)
HSSFRow.MissingCellPolicy
on the base workbook.
cellnum
- 0 based column number
public HSSFCell getCell(int cellnum, HSSFRow.MissingCellPolicy policy)
cellnum
- 0 based column numberpolicy
- Policy on blank / missing cells
public short getFirstCellNum()
public short getLastCellNum()
short minColIx = row.getFirstCellNum(); short maxColIx = row.getLastCellNum(); for(short colIx=minColIx; colIx<maxColIx; colIx++) { HSSFCell cell = row.getCell(colIx); if(cell == null) { continue; } //... do something with cell }
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()
public java.util.Iterator cellIterator()
public java.util.Iterator iterator()
CellIterator
to allow
foreach loops
public int compareTo(java.lang.Object obj)
compareTo
in interface java.lang.Comparable
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |