| Modifier and Type | Class and Description |
|---|---|
| private class | HSSFRow.
An iterator over the (physical) cells in the row. |
| Modifier and Type | Field and Description |
|---|---|
| private final HSSFWorkbook | book
reference to containing low level Workbook |
| private HSSFCell[] | |
| public static final int | |
| private final RowRecord | row
reference to low level representation |
| private int | |
| private final HSSFSheet | sheet
reference to containing Sheet |
| Access | Constructor and Description |
|---|---|
| pack-priv | HSSFRow(HSSFWorkbook
low-level Workbook object containing the sheet that contains this row book, HSSFSheet low-level Sheet object that contains this Row sheet, int the row number of this row (0 based) rowNum)Creates new HSSFRow from scratch. |
| pack-priv | HSSFRow(HSSFWorkbook
low-level Workbook object containing the sheet that contains this row book, HSSFSheet low-level Sheet object that contains this Row sheet, RowRecord the low level api object this row should represent record)Creates an HSSFRow from a low level RowRecord object. |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| private int | Returns: 0 when row contains no cells (also when first cell is occupied)used internally to refresh the "first cell" when the first cell is removed. |
| private int | Returns: 0 when row contains no cellsused internally to refresh the "last cell plus one" when the last cell is removed. |
| public Iterator | Returns: cell iterator of the physically defined cells. Note that the 4th element might well not be cell 4, as the iterator will not return un-defined (null) cells. Call getCellNum() on the returned cells to know which cell they are. As this only ever works on physically defined cells, theorg. has no effect.Implements org.
|
| public int | Returns:
the other)HSSFRow to be compared.Implements java. Compares two |
| public void | copyRowFrom(Row
the rows to copy from srcRow, CellCopyPolicy the policy to determine what gets copied policy)Copy the cells from srcRow to this row If this row is not a blank row, this will merge the two rows, overwriting the cells in this row with the cells in srcRow If srcRow is null, overwrite cells in destination row with blank values, styles, etc per cell copy policy srcRow may be from a different sheet in the same workbook |
| public void | copyRowFrom(Row
the rows to copy from srcRow, CellCopyPolicy the policy to determine what gets copied policy, CellCopyContext the context - see context)CellCopyContextCopy the cells from srcRow to this row. |
| public HSSFCell | Returns: HSSFCell a high level representation of the created cell.- the column number this cell represents column)Implements org. Use this to create new cells within the row and return it. |
| public HSSFCell | Returns: HSSFCell a high level representation of the created cell.- the column number this cell represents columnIndex, CellType - the cell's data type type)Implements org. Use this to create new cells within the row and return it. |
| pack-priv HSSFCell | Returns: HSSFCell representing the low level record passed inlow level cell to create the high level representation from cell)create a high level HSSFCell object from an existing low level record. |
| public boolean | equals(Object
the reference object with which to compare. obj)Overrides java. Indicates whether some other object is "equal to" this one. |
| private void | |
| public HSSFCell | Returns: HSSFCell representing that column or null if undefined.0 based column number cellnum)Implements org. Get the hssfcell representing a given column (logical cell) 0-based. |
| public HSSFCell | Returns: representing that column or null if undefined + policy allows.0 based column number cellnum, Row.Policy on blank / missing cells policyImplements org. Get the hssfcell representing a given column (logical cell) 0-based. |
| public short | Returns: short representing the first logical cell in the row, or -1 if the row does not contain any cells.Implements org. get the number of the first cell contained in this row. |
| public short | Returns: rowheight or 0xff for undefined (use sheet default)Implements org. get the row's height or ff (-1) for undefined/default-height in twips (1/20th of a point) |
| public float | Returns: rowheight or 0xff for undefined (use sheet default)Implements org. get the row's height or ff (-1) for undefined/default-height in points (20*getHeight()) |
| public short | Returns: short representing the last logical cell in the row PLUS ONE, or -1 if the row does not contain any cells.Implements org. Gets the index of the last cell contained in this row PLUS ONE. |
| public int | getOutlineLevel()
Implements org. Returns the rows outline level. |
| public int | Returns: int representing the number of defined cells in the row.Implements org. gets the number of defined cells (NOT number of cells in the actual row!). |
| public int | Returns: the row number (0 based)Implements org. get row number this row represents |
| protected RowRecord | Returns: RowRecord this row representsget the lowlevel RowRecord represented by this object - should only be called by other parts of the high level API |
| public HSSFCellStyle | getRowStyle()
Implements org. Returns the whole-row cell styles. |
| public HSSFSheet | Returns: the HSSFSheet that owns this rowImplements org. Returns the HSSFSheet this row belongs to |
| public boolean | Returns: - zHeight height is zero or not.Implements org. get whether or not to display this row with 0 height |
| public int | |
| public boolean | |
| public void | |
| protected void | |
| public void | removeCell(Cell
to remove cell)Implements org. remove the HSSFCell from this row. |
| private void | |
| private HSSFCell | Returns: HSSFCell representing that column or null if undefined.0 based column number cellIndex)Get the hssfcell representing a given column (logical cell) 0-based. |
| public void | setHeight(short
rowheight or -1 for undefined (use sheet default) height)Implements org. set the row's height or set to ff (-1) for undefined/default-height. |
| public void | setHeightInPoints(float
row height in points, height)-1 means to use the default heightImplements org. set the row's height in points. |
| public void | setRowNum(int
the row number (0-based) rowIndex)Implements org. set the row number of this row. |
| public void | |
| public void | setRowStyle(CellStyle style)
Implements org. Applies a whole-row cell styling to the row. |
| public void | setZeroHeight(boolean
height is zero or not. zHeight)Implements org. set whether or not to display this row with 0 height |
| public void | shiftCellsLeft(int
the column to start shifting firstShiftColumnIndex, int the column to end shifting lastShiftColumnIndex, int length of the shifting step step)Implements org. Shifts column range [firstShiftColumnIndex-lastShiftColumnIndex] step places to the left. |
| public void | shiftCellsRight(int
the column to start shifting firstShiftColumnIndex, int the column to end shifting lastShiftColumnIndex, int length of the shifting step step)Implements org. Shifts column range [firstShiftColumnIndex-lastShiftColumnIndex] step places to the right. |
| book | back to summary |
|---|---|
| private final HSSFWorkbook book reference to containing low level Workbook | |
| cells | back to summary |
|---|---|
| private HSSFCell[] cells | |
| INITIAL_CAPACITY | back to summary |
|---|---|
| public static final int INITIAL_CAPACITY | |
| row | back to summary |
|---|---|
| private final RowRecord row reference to low level representation | |
| rowNum | back to summary |
|---|---|
| private int rowNum | |
| sheet | back to summary |
|---|---|
| private final HSSFSheet sheet reference to containing Sheet | |
| HSSFRow | back to summary |
|---|---|
| pack-priv HSSFRow(HSSFWorkbook book, HSSFSheet sheet, int rowNum) Creates new HSSFRow from scratch. Only HSSFSheet should do this.
| |
| HSSFRow | back to summary |
|---|---|
| pack-priv HSSFRow(HSSFWorkbook book, HSSFSheet sheet, RowRecord record) Creates an HSSFRow from a low level RowRecord object. Only HSSFSheet should do this. HSSFSheet uses this when an existing file is read in.
| |
| addCell | back to summary |
|---|---|
| private void addCell(HSSFCell cell) used internally to add a cell. | |
| calculateNewFirstCell | back to summary |
|---|---|
| private int calculateNewFirstCell(int firstcell) used internally to refresh the "first cell" when the first cell is removed.
| |
| calculateNewLastCellPlusOne | back to summary |
|---|---|
| private int calculateNewLastCellPlusOne(int lastcell) used internally to refresh the "last cell plus one" when the last cell is removed.
| |
| cellIterator | back to summary |
|---|---|
| public Iterator Implements org.
| |
| compareTo | back to summary |
|---|---|
| public int compareTo(HSSFRow other) Implements java. Compares two
| |
| copyRowFrom | back to summary |
|---|---|
| public void copyRowFrom(Row srcRow, CellCopyPolicy policy) Copy the cells from srcRow to this row If this row is not a blank row, this will merge the two rows, overwriting the cells in this row with the cells in srcRow If srcRow is null, overwrite cells in destination row with blank values, styles, etc per cell copy policy srcRow may be from a different sheet in the same workbook
| |
| copyRowFrom | back to summary |
|---|---|
| public void copyRowFrom(Row srcRow, CellCopyPolicy policy, CellCopyContext context) Copy the cells from srcRow to this row.
If this row is not a blank row, this will merge the two rows, overwriting
the cells in this row with the cells in srcRow.
If srcRow is null, overwrite cells in destination row with blank values, styles, etc per cell copy policy.
Note that if you are copying from a non-HSSF row then you will need to disable style copying
in the
| |
| createCell | back to summary |
|---|---|
| public HSSFCell createCell(int column) Implements org. Use this to create new cells within the row and return it.
The cell that is returned is a
| |
| createCell | back to summary |
|---|---|
| public HSSFCell createCell(int columnIndex, CellType type) Implements org. Use this to create new cells within the row and return it. The cell that is returned will be of the requested type. The type can be changed either through calling setCellValue or setCellType, but there is a small overhead to doing this, so it is best to create the required type up front.
| |
| createCellFromRecord | back to summary |
|---|---|
| pack-priv HSSFCell createCellFromRecord(CellValueRecordInterface cell) create a high level HSSFCell object from an existing low level record. Should only be called from HSSFSheet or HSSFRow itself.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| extend | back to summary |
|---|---|
| private void extend(int newLength) | |
| getCell | back to summary |
|---|---|
| public HSSFCell getCell(int cellnum) Implements org. Get the hssfcell representing a given column (logical cell)
0-based. If you ask for a cell that is not defined then
you get a null, unless you have set a different
| |
| getCell | back to summary |
|---|---|
| public HSSFCell getCell(int cellnum, Row. Implements org. Get the hssfcell representing a given column (logical cell) 0-based. If you ask for a cell that is not defined, then your supplied policy says what to do
| |
| getFirstCellNum | back to summary |
|---|---|
| public short getFirstCellNum() Implements org. get the number of the first cell contained in this row.
| |
| getHeight | back to summary |
|---|---|
| public short getHeight() Implements org. get the row's height or ff (-1) for undefined/default-height in twips (1/20th of a point)
| |
| getHeightInPoints | back to summary |
|---|---|
| public float getHeightInPoints() Implements org. get the row's height or ff (-1) for undefined/default-height in points (20*getHeight())
| |
| getLastCellNum | back to summary |
|---|---|
| public short getLastCellNum() Implements org. Gets the index of the last cell contained in this row PLUS ONE. The result also happens to be the 1-based column number of the last cell. This value can be used as a standard upper bound when iterating over cells:
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
}
| |
| getOutlineLevel | back to summary |
|---|---|
| public int getOutlineLevel() Implements org. Returns the rows outline level. Increased as you put it into more groups (outlines), reduced as you take it out of them.
| |
| getPhysicalNumberOfCells | back to summary |
|---|---|
| public int getPhysicalNumberOfCells() Implements org. gets the number of defined cells (NOT number of cells in the actual row!). That is to say if only columns 0,4,5 have values then there would be 3.
| |
| getRowNum | back to summary |
|---|---|
| public int getRowNum() Implements org. get row number this row represents
| |
| getRowRecord | back to summary |
|---|---|
| protected RowRecord getRowRecord() get the lowlevel RowRecord represented by this object - should only be called by other parts of the high level API
| |
| getRowStyle | back to summary |
|---|---|
| public HSSFCellStyle getRowStyle() Implements org. Returns the whole-row cell styles. Most rows won't
have one of these, so will return null. Call
| |
| getSheet | back to summary |
|---|---|
| public HSSFSheet getSheet() Implements org. Returns the HSSFSheet this row belongs to | |
| getZeroHeight | back to summary |
|---|---|
| public boolean getZeroHeight() Implements org. get whether or not to display this row with 0 height
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| isFormatted | back to summary |
|---|---|
| public boolean isFormatted() Implements org. Is this row formatted? Most aren't, but some rows
do have whole-row styles. For those that do, you
can get the formatting from
| |
| moveCell | back to summary |
|---|---|
| public void moveCell(HSSFCell cell, short newColumn) Moves the supplied cell to a new column, which must not already have a cell there!
| |
| removeAllCells | back to summary |
|---|---|
| protected void removeAllCells() Removes all the cells from the row, and their records too. | |
| removeCell | back to summary |
|---|---|
| public void removeCell(Cell cell) Implements org. remove the HSSFCell from this row. | |
| removeCell | back to summary |
|---|---|
| private void removeCell(HSSFCell cell, boolean alsoRemoveRecords) | |
| retrieveCell | back to summary |
|---|---|
| private HSSFCell retrieveCell(int cellIndex) Get the hssfcell representing a given column (logical cell) 0-based. If you ask for a cell that is not defined, then you get a null. This is the basic call, with no policies applied
| |
| setHeight | back to summary |
|---|---|
| public void setHeight(short height) Implements org. set the row's height or set to ff (-1) for undefined/default-height. Set the height in "twips" or 1/20th of a point.
| |
| setHeightInPoints | back to summary |
|---|---|
| public void setHeightInPoints(float height) Implements org. set the row's height in points.
| |
| setRowNum | back to summary |
|---|---|
| public void setRowNum(int rowIndex) Implements org. set the row number of this row.
| |
| setRowStyle | back to summary |
|---|---|
| public void setRowStyle(HSSFCellStyle style) Applies a whole-row cell styling to the row. | |
| setRowStyle | back to summary |
|---|---|
| public void setRowStyle(CellStyle style) Implements org. Applies a whole-row cell styling to the row.
| |
| setZeroHeight | back to summary |
|---|---|
| public void setZeroHeight(boolean zHeight) Implements org. set whether or not to display this row with 0 height
| |
| shiftCellsLeft | back to summary |
|---|---|
| public void shiftCellsLeft(int firstShiftColumnIndex, int lastShiftColumnIndex, int step) Implements org. Shifts column range [firstShiftColumnIndex-lastShiftColumnIndex] step places to the left.
| |
| shiftCellsRight | back to summary |
|---|---|
| public void shiftCellsRight(int firstShiftColumnIndex, int lastShiftColumnIndex, int step) Implements org. Shifts column range [firstShiftColumnIndex-lastShiftColumnIndex] step places to the right.
| |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public boolean | |
| public Cell | |
| public void | remove()
Overrides default java. Removes from the underlying collection the last element returned by this iterator (optional operation). |
| CellIterator | back to summary |
|---|---|
| public CellIterator() | |
| findNext | back to summary |
|---|---|
| private void findNext() | |
| hasNext | back to summary |
|---|---|
| public boolean hasNext() Implements java. Doc from java. Returns
| |
| next | back to summary |
|---|---|
| public Cell next() Implements java. Doc from java. Returns the next element in the iteration. | |
| remove | back to summary |
|---|---|
| public void remove() Overrides default java. Doc from java. Removes from the underlying collection the last element returned
by this iterator (optional operation). This method can be called
only once per call to The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method, unless an overriding class has specified a concurrent modification policy.
The behavior of an iterator is unspecified if this method is called
after a call to the
| |