Top Description Inners Fields Constructors Methods
org.apache.poi.hssf.usermodel

public final Class HSSFRow

extends Object
implements Row, Comparable<HSSFRow>
Class Inheritance
All Implemented Interfaces
java.lang.Comparable, org.apache.poi.ss.usermodel.Row, java.lang.Iterable
Imports
java.util.HashSet, .Iterator, .NoSuchElementException, .Set, org.apache.poi.hssf.record.CellValueRecordInterface, .ExtendedFormatRecord, .RowRecord, org.apache.poi.hssf.usermodel.helpers.HSSFRowShifter, org.apache.poi.ss.SpreadsheetVersion, org.apache.poi.ss.formula.FormulaShifter, org.apache.poi.ss.usermodel.Cell, .CellCopyContext, .CellCopyPolicy, .CellStyle, .CellType, .Row, org.apache.poi.ss.usermodel.helpers.RowShifter, org.apache.poi.ss.util.CellRangeAddress, .CellUtil, org.apache.poi.util.Beta, .Configurator

High level representation of a row of a spreadsheet. Only rows that have cells should be added to a Sheet.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
HSSFRow.CellIterator

An iterator over the (physical) cells in the row.

Field Summary

Modifier and TypeField 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

Constructor Summary

AccessConstructor 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.

Method Summary

Modifier and TypeMethod and Description
private void
addCell(HSSFCell cell)

used internally to add a cell.

private int

Returns:

0 when row contains no cells (also when first cell is occupied)
calculateNewFirstCell
(int firstcell)

used internally to refresh the "first cell" when the first cell is removed.

private int

Returns:

0 when row contains no cells
calculateNewLastCellPlusOne
(int lastcell)

used internally to refresh the "last cell plus one" when the last cell is removed.

public Iterator<Cell>

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, the org.apache.poi.ss.usermodel.Row.MissingCellPolicy has no effect.
cellIterator
()

Implements org.apache.poi.ss.usermodel.Row.cellIterator.

public int

Returns:

  • the value 0 if the row number of this HSSFRow is equal to the row number of the argument HSSFRow
  • a value less than 0 if the row number of this HSSFRow is numerically less than the row number of the argument HSSFRow
  • a value greater than 0 if the row number of this HSSFRow is numerically greater than the row number of the argument HSSFRow
compareTo
(HSSFRow
the HSSFRow to be compared.
other
)

Implements java.lang.Comparable.compareTo.

Compares two HSSFRow objects.

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 CellCopyContext
context
)

Copy the cells from srcRow to this row.

public HSSFCell

Returns:

HSSFCell a high level representation of the created cell.
createCell
(int
- the column number this cell represents
column
)

Implements org.apache.poi.ss.usermodel.Row.createCell.

Use this to create new cells within the row and return it.

public HSSFCell

Returns:

HSSFCell a high level representation of the created cell.
createCell
(int
- the column number this cell represents
columnIndex
,
CellType
- the cell's data type
type
)

Implements org.apache.poi.ss.usermodel.Row.createCell.

Use this to create new cells within the row and return it.

pack-priv HSSFCell

Returns:

HSSFCell representing the low level record passed in
createCellFromRecord
(CellValueRecordInterface
low 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.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

private void
extend(int newLength)

public HSSFCell

Returns:

HSSFCell representing that column or null if undefined.
getCell
(int
0 based column number
cellnum
)

Implements org.apache.poi.ss.usermodel.Row.getCell.

Get the hssfcell representing a given column (logical cell) 0-based.

public HSSFCell

Returns:

representing that column or null if undefined + policy allows.
getCell
(int
0 based column number
cellnum
,
Row.MissingCellPolicy
Policy on blank / missing cells
policy
)

Implements org.apache.poi.ss.usermodel.Row.getCell.

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.
getFirstCellNum
()

Implements org.apache.poi.ss.usermodel.Row.getFirstCellNum.

get the number of the first cell contained in this row.

public short

Returns:

rowheight or 0xff for undefined (use sheet default)
getHeight
()

Implements org.apache.poi.ss.usermodel.Row.getHeight.

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)
getHeightInPoints
()

Implements org.apache.poi.ss.usermodel.Row.getHeightInPoints.

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.
getLastCellNum
()

Implements org.apache.poi.ss.usermodel.Row.getLastCellNum.

Gets the index of the last cell contained in this row PLUS ONE.

public int
getOutlineLevel()

Implements org.apache.poi.ss.usermodel.Row.getOutlineLevel.

Returns the rows outline level.

public int

Returns:

int representing the number of defined cells in the row.
getPhysicalNumberOfCells
()

Implements org.apache.poi.ss.usermodel.Row.getPhysicalNumberOfCells.

gets the number of defined cells (NOT number of cells in the actual row!).

public int

Returns:

the row number (0 based)
getRowNum
()

Implements org.apache.poi.ss.usermodel.Row.getRowNum.

get row number this row represents

protected RowRecord

Returns:

RowRecord this row represents
getRowRecord
()

get the lowlevel RowRecord represented by this object - should only be called by other parts of the high level API

public HSSFCellStyle
getRowStyle()

Implements org.apache.poi.ss.usermodel.Row.getRowStyle.

Returns the whole-row cell styles.

public HSSFSheet

Returns:

the HSSFSheet that owns this row
getSheet
()

Implements org.apache.poi.ss.usermodel.Row.getSheet.

Returns the HSSFSheet this row belongs to

public boolean

Returns:

- zHeight height is zero or not.
getZeroHeight
()

Implements org.apache.poi.ss.usermodel.Row.getZeroHeight.

get whether or not to display this row with 0 height

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public boolean
isFormatted()

Implements org.apache.poi.ss.usermodel.Row.isFormatted.

Is this row formatted?

public void
moveCell(HSSFCell
The cell to move
cell
,
short
The new column number (0 based)
newColumn
)

Moves the supplied cell to a new column, which must not already have a cell there!

protected void
removeAllCells()

Removes all the cells from the row, and their records too.

public void
removeCell(Cell
to remove
cell
)

Implements org.apache.poi.ss.usermodel.Row.removeCell.

remove the HSSFCell from this row.

private void
removeCell(HSSFCell cell, boolean alsoRemoveRecords)

private HSSFCell

Returns:

HSSFCell representing that column or null if undefined.
retrieveCell
(int
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.apache.poi.ss.usermodel.Row.setHeight.

set the row's height or set to ff (-1) for undefined/default-height.

public void
setHeightInPoints(float
row height in points, -1 means to use the default height
height
)

Implements org.apache.poi.ss.usermodel.Row.setHeightInPoints.

set the row's height in points.

public void
setRowNum(int
the row number (0-based)
rowIndex
)

Implements org.apache.poi.ss.usermodel.Row.setRowNum.

set the row number of this row.

public void
setRowStyle(HSSFCellStyle style)

Applies a whole-row cell styling to the row.

public void
setRowStyle(CellStyle style)

Implements org.apache.poi.ss.usermodel.Row.setRowStyle.

Applies a whole-row cell styling to the row.

public void
setZeroHeight(boolean
height is zero or not.
zHeight
)

Implements org.apache.poi.ss.usermodel.Row.setZeroHeight.

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.apache.poi.ss.usermodel.Row.shiftCellsLeft.

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.apache.poi.ss.usermodel.Row.shiftCellsRight.

Shifts column range [firstShiftColumnIndex-lastShiftColumnIndex] step places to the right.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

bookback to summary
private final HSSFWorkbook book

reference to containing low level Workbook

cellsback to summary
private HSSFCell[] cells
INITIAL_CAPACITYback to summary
public static final int INITIAL_CAPACITY
rowback to summary
private final RowRecord row

reference to low level representation

rowNumback to summary
private int rowNum
sheetback to summary
private final HSSFSheet sheet

reference to containing Sheet

Constructor Detail

HSSFRowback to summary
pack-priv HSSFRow(HSSFWorkbook book, HSSFSheet sheet, int rowNum)

Creates new HSSFRow from scratch. Only HSSFSheet should do this.

Parameters
book:HSSFWorkbook

low-level Workbook object containing the sheet that contains this row

sheet:HSSFSheet

low-level Sheet object that contains this Row

rowNum:int

the row number of this row (0 based)

See Also
org.apache.poi.hssf.usermodel.HSSFSheet#createRow(int)
HSSFRowback 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.

Parameters
book:HSSFWorkbook

low-level Workbook object containing the sheet that contains this row

sheet:HSSFSheet

low-level Sheet object that contains this Row

record:RowRecord

the low level api object this row should represent

See Also
org.apache.poi.hssf.usermodel.HSSFSheet#createRow(int)

Method Detail

addCellback to summary
private void addCell(HSSFCell cell)

used internally to add a cell.

calculateNewFirstCellback to summary
private int calculateNewFirstCell(int firstcell)

used internally to refresh the "first cell" when the first cell is removed.

Returns:int

0 when row contains no cells (also when first cell is occupied)

calculateNewLastCellPlusOneback to summary
private int calculateNewLastCellPlusOne(int lastcell)

used internally to refresh the "last cell plus one" when the last cell is removed.

Returns:int

0 when row contains no cells

cellIteratorback to summary
public Iterator<Cell> cellIterator()

Implements org.apache.poi.ss.usermodel.Row.cellIterator.

Returns:Iterator<Cell>

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, the org.apache.poi.ss.usermodel.Row.MissingCellPolicy has no effect.

Annotations
@Override
compareToback to summary
public int compareTo(HSSFRow other)

Implements java.lang.Comparable.compareTo.

Compares two HSSFRow objects. Two rows are equal if they belong to the same worksheet and their row indexes are equal.

Parameters
other:HSSFRow

the HSSFRow to be compared.

Returns:int

  • the value 0 if the row number of this HSSFRow is equal to the row number of the argument HSSFRow
  • a value less than 0 if the row number of this HSSFRow is numerically less than the row number of the argument HSSFRow
  • a value greater than 0 if the row number of this HSSFRow is numerically greater than the row number of the argument HSSFRow
Annotations
@Override
Exceptions
IllegalArgumentException:
if the argument row belongs to a different worksheet
copyRowFromback 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

Parameters
srcRow:Row

the rows to copy from

policy:CellCopyPolicy

the policy to determine what gets copied

Annotations
@Beta
copyRowFromback 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 CellCopyPolicy (HSSF styles are not compatible with XSSF styles, for instance).

Parameters
srcRow:Row

the rows to copy from

policy:CellCopyPolicy

the policy to determine what gets copied

context:CellCopyContext

the context - see CellCopyContext

Annotations
@Beta
Since
v5.1.0
createCellback to summary
public HSSFCell createCell(int column)

Implements org.apache.poi.ss.usermodel.Row.createCell.

Use this to create new cells within the row and return it.

The cell that is returned is a CellType#BLANK. The type can be changed either through calling setCellValue or setCellType.

Parameters
column:int

- the column number this cell represents

Returns:HSSFCell

HSSFCell a high level representation of the created cell.

Annotations
@Override
Exceptions
IllegalArgumentException:
if columnIndex < 0 or greater than 255, the maximum number of columns supported by the Excel binary format (.xls)
createCellback to summary
public HSSFCell createCell(int columnIndex, CellType type)

Implements org.apache.poi.ss.usermodel.Row.createCell.

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.

Parameters
columnIndex:int

- the column number this cell represents

type:CellType

Doc from org.apache.poi.ss.usermodel.Row.createCell.

- the cell's data type

Returns:HSSFCell

HSSFCell a high level representation of the created cell.

Annotations
@Override
Exceptions
IllegalArgumentException:
if columnIndex < 0 or greater than 255, the maximum number of columns supported by the Excel binary format (.xls)
createCellFromRecordback 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.

Parameters
cell:CellValueRecordInterface

low level cell to create the high level representation from

Returns:HSSFCell

HSSFCell representing the low level record passed in

equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

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.

Parameters
obj:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
extendback to summary
private void extend(int newLength)
getCellback to summary
public HSSFCell getCell(int cellnum)

Implements org.apache.poi.ss.usermodel.Row.getCell.

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 org.apache.poi.ss.usermodel.Row.MissingCellPolicy on the base workbook.

Parameters
cellnum:int

0 based column number

Returns:HSSFCell

HSSFCell representing that column or null if undefined.

Annotations
@Override
getCellback to summary
public HSSFCell getCell(int cellnum, Row.MissingCellPolicy policy)

Implements org.apache.poi.ss.usermodel.Row.getCell.

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

Parameters
cellnum:int

0 based column number

policy:Row.MissingCellPolicy

Policy on blank / missing cells

Returns:HSSFCell

representing that column or null if undefined + policy allows.

Annotations
@Override
getFirstCellNumback to summary
public short getFirstCellNum()

Implements org.apache.poi.ss.usermodel.Row.getFirstCellNum.

get the number of the first cell contained in this row.

Returns:short

short representing the first logical cell in the row, or -1 if the row does not contain any cells.

Annotations
@Override
getHeightback to summary
public short getHeight()

Implements org.apache.poi.ss.usermodel.Row.getHeight.

get the row's height or ff (-1) for undefined/default-height in twips (1/20th of a point)

Returns:short

rowheight or 0xff for undefined (use sheet default)

Annotations
@Override
getHeightInPointsback to summary
public float getHeightInPoints()

Implements org.apache.poi.ss.usermodel.Row.getHeightInPoints.

get the row's height or ff (-1) for undefined/default-height in points (20*getHeight())

Returns:float

rowheight or 0xff for undefined (use sheet default)

Annotations
@Override
getLastCellNumback to summary
public short getLastCellNum()

Implements org.apache.poi.ss.usermodel.Row.getLastCellNum.

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
}
Returns:short

short representing the last logical cell in the row PLUS ONE, or -1 if the row does not contain any cells.

Annotations
@Override
getOutlineLevelback to summary
public int getOutlineLevel()

Implements org.apache.poi.ss.usermodel.Row.getOutlineLevel.

Returns the rows outline level. Increased as you put it into more groups (outlines), reduced as you take it out of them.

Annotations
@Override
getPhysicalNumberOfCellsback to summary
public int getPhysicalNumberOfCells()

Implements org.apache.poi.ss.usermodel.Row.getPhysicalNumberOfCells.

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.

Returns:int

int representing the number of defined cells in the row.

Annotations
@Override
getRowNumback to summary
public int getRowNum()

Implements org.apache.poi.ss.usermodel.Row.getRowNum.

get row number this row represents

Returns:int

the row number (0 based)

Annotations
@Override
getRowRecordback 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

Returns:RowRecord

RowRecord this row represents

getRowStyleback to summary
public HSSFCellStyle getRowStyle()

Implements org.apache.poi.ss.usermodel.Row.getRowStyle.

Returns the whole-row cell styles. Most rows won't have one of these, so will return null. Call isFormatted() to check first.

Annotations
@Override
getSheetback to summary
public HSSFSheet getSheet()

Implements org.apache.poi.ss.usermodel.Row.getSheet.

Returns the HSSFSheet this row belongs to

Returns:HSSFSheet

the HSSFSheet that owns this row

Annotations
@Override
getZeroHeightback to summary
public boolean getZeroHeight()

Implements org.apache.poi.ss.usermodel.Row.getZeroHeight.

get whether or not to display this row with 0 height

Returns:boolean

- zHeight height is zero or not.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

Annotations
@Override
isFormattedback to summary
public boolean isFormatted()

Implements org.apache.poi.ss.usermodel.Row.isFormatted.

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 getRowStyle()

Annotations
@Override
moveCellback 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!

Parameters
cell:HSSFCell

The cell to move

newColumn:short

The new column number (0 based)

removeAllCellsback to summary
protected void removeAllCells()

Removes all the cells from the row, and their records too.

removeCellback to summary
public void removeCell(Cell cell)

Implements org.apache.poi.ss.usermodel.Row.removeCell.

remove the HSSFCell from this row.

Parameters
cell:Cell

to remove

Annotations
@Override
removeCellback to summary
private void removeCell(HSSFCell cell, boolean alsoRemoveRecords)
retrieveCellback 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

Parameters
cellIndex:int

0 based column number

Returns:HSSFCell

HSSFCell representing that column or null if undefined.

setHeightback to summary
public void setHeight(short height)

Implements org.apache.poi.ss.usermodel.Row.setHeight.

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.

Parameters
height:short

rowheight or -1 for undefined (use sheet default)

Annotations
@Override
setHeightInPointsback to summary
public void setHeightInPoints(float height)

Implements org.apache.poi.ss.usermodel.Row.setHeightInPoints.

set the row's height in points.

Parameters
height:float

row height in points, -1 means to use the default height

Annotations
@Override
setRowNumback to summary
public void setRowNum(int rowIndex)

Implements org.apache.poi.ss.usermodel.Row.setRowNum.

set the row number of this row.

Parameters
rowIndex:int

the row number (0-based)

Annotations
@Override
Exceptions
IndexOutOfBoundsException:
if the row number is not within the range 0-65535.
setRowStyleback to summary
public void setRowStyle(HSSFCellStyle style)

Applies a whole-row cell styling to the row.

setRowStyleback to summary
public void setRowStyle(CellStyle style)

Implements org.apache.poi.ss.usermodel.Row.setRowStyle.

Applies a whole-row cell styling to the row.

Annotations
@Override
setZeroHeightback to summary
public void setZeroHeight(boolean zHeight)

Implements org.apache.poi.ss.usermodel.Row.setZeroHeight.

set whether or not to display this row with 0 height

Parameters
zHeight:boolean

height is zero or not.

Annotations
@Override
shiftCellsLeftback to summary
public void shiftCellsLeft(int firstShiftColumnIndex, int lastShiftColumnIndex, int step)

Implements org.apache.poi.ss.usermodel.Row.shiftCellsLeft.

Shifts column range [firstShiftColumnIndex-lastShiftColumnIndex] step places to the left.

Parameters
firstShiftColumnIndex:int

the column to start shifting

lastShiftColumnIndex:int

the column to end shifting

step:int

length of the shifting step

Annotations
@Override
shiftCellsRightback to summary
public void shiftCellsRight(int firstShiftColumnIndex, int lastShiftColumnIndex, int step)

Implements org.apache.poi.ss.usermodel.Row.shiftCellsRight.

Shifts column range [firstShiftColumnIndex-lastShiftColumnIndex] step places to the right.

Parameters
firstShiftColumnIndex:int

the column to start shifting

lastShiftColumnIndex:int

the column to end shifting

step:int

length of the shifting step

Annotations
@Override
org.apache.poi.hssf.usermodel back to summary

private Class HSSFRow.CellIterator

extends Object
implements Iterator<Cell>
Class Inheritance
All Implemented Interfaces
java.util.Iterator

An iterator over the (physical) cells in the row.

Field Summary

Modifier and TypeField and Description
pack-priv int
pack-priv int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
public boolean
hasNext()

Implements java.util.Iterator.hasNext.

Returns true if the iteration has more elements.

public Cell
next()

Implements java.util.Iterator.next.

Returns the next element in the iteration.

public void
remove()

Overrides default java.util.Iterator.remove.

Removes from the underlying collection the last element returned by this iterator (optional operation).

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

nextIdback to summary
pack-priv int nextId
thisIdback to summary
pack-priv int thisId

Constructor Detail

CellIteratorback to summary
public CellIterator()

Method Detail

findNextback to summary
private void findNext()
hasNextback to summary
public boolean hasNext()

Implements java.util.Iterator.hasNext.

Doc from java.util.Iterator.hasNext.

Returns true if the iteration has more elements. (In other words, returns true if next would return an element rather than throwing an exception.)

Returns:boolean

true if the iteration has more elements

Annotations
@Override
nextback to summary
public Cell next()

Implements java.util.Iterator.next.

Doc from java.util.Iterator.next.

Returns the next element in the iteration.

Returns:Cell

the next element in the iteration

Annotations
@Override
removeback to summary
public void remove()

Overrides default java.util.Iterator.remove.

Doc from java.util.Iterator.remove.

Removes from the underlying collection the last element returned by this iterator (optional operation). This method can be called only once per call to next.

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 forEachRemaining method.

Annotations
@Override