Modifier and Type | Class and Description |
---|---|
class |
SXSSFRow.CellIterator
returns all cells including empty cells (
null values are returned for empty cells).
(返回所有单元格,包括空单元格(空单元格返回空值)。)
|
class |
SXSSFRow.FilledCellIterator
Create an iterator over the cells from [0, getLastCellNum()).
(在 [0, getLastCellNum()) 的单元格上创建一个迭代器。)
|
Row.MissingCellPolicy
Constructor and Description |
---|
SXSSFRow(SXSSFSheet sheet) |
Modifier and Type | Method and Description |
---|---|
java.util.Iterator<Cell> |
allCellsIterator() |
java.util.Iterator<Cell> |
cellIterator() |
int |
compareTo(SXSSFRow other)
Compares two
SXSSFRow objects.
(比较两个 SXSSFRow 对象。)
|
SXSSFCell |
createCell(int column)
Use this to create new cells within the row and return it.
(使用它在行内创建新单元格并将其返回。)
|
SXSSFCell |
createCell(int column, CellType type)
Use this to create new cells within the row and return it.
(使用它在行内创建新单元格并将其返回。)
|
boolean |
equals(java.lang.Object obj) |
SXSSFCell |
getCell(int cellnum)
Get the cell representing a given column (logical cell) 0-based.
(获取表示给定列(逻辑单元格)的单元格,从 0 开始。)
|
SXSSFCell |
getCell(int cellnum, Row.MissingCellPolicy policy)
Returns the cell at the given (0 based) index, with the specified
Row.MissingCellPolicy
(返回给定(基于 0)索引处的单元格,具有指定的 Row.MissingCellPolicy)
|
java.lang.Boolean |
getCollapsed() |
short |
getFirstCellNum()
Get the number of the first cell contained in this row.
(获取此行中包含的第一个单元格的编号。)
|
short |
getHeight()
Get the row's height measured in twips (1/20th of a point).
(获取以缇为单位的行高(1/20 点)。)
|
float |
getHeightInPoints()
Returns row height measured in point size.
(返回以磅为单位测量的行高。)
|
java.lang.Boolean |
getHidden()
get row hidden state: Hidden (true), Unhidden (false), Undefined (null)
(获取行隐藏状态:Hidden (true)、Unhidden (false)、Undefined (null))
|
short |
getLastCellNum()
Gets the index of the last cell contained in this row
PLUS ONE.
(获取此行 PLUS ONE 中包含的最后一个单元格的索引。)
|
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
(获取此行代表的行号)
|
CellStyle |
getRowStyle()
Returns the whole-row cell style.
(返回整行单元格样式。)
|
SXSSFSheet |
getSheet()
Returns the Sheet this row belongs to
(返回此行所属的工作表)
|
boolean |
getZeroHeight()
Get whether or not to display this row with 0 height
(获取是否以0高度显示该行)
|
boolean |
hasCustomHeight() |
int |
hashCode() |
boolean |
isFormatted()
Is this row formatted? Most aren't, but some rows do have whole-row styles.
(此行是否已格式化?大多数不是,但有些行确实具有整行样式。)
|
java.util.Iterator<Cell> |
iterator() |
void |
removeCell(Cell cell)
Remove the Cell from this row.
(从此行中删除单元格。)
|
void |
setCollapsed(java.lang.Boolean collapsed) |
void |
setHeight(short height)
Set the row's height or set to ff (-1) for undefined/default-height.
(为未定义/默认高度设置行高或设置为 ff (-1)。)
|
void |
setHeightInPoints(float height)
Set the row's height in points.
(以磅为单位设置行高。)
|
void |
setHidden(java.lang.Boolean hidden)
set row hidden state: Hidden (true), Unhidden (false), Undefined (null)
(设置行隐藏状态:Hidden (true)、Unhidden (false)、Undefined (null))
|
void |
setRowNum(int rowNum)
Set the row number of this row.
(设置该行的行号。)
|
void |
setRowStyle(CellStyle style)
Applies a whole-row cell styling to the row.
(将整行单元格样式应用于行。)
|
void |
setZeroHeight(boolean zHeight)
Set whether or not to display this row with 0 height
(设置是否以0高度显示该行)
|
void |
shiftCellsLeft(int firstShiftColumnIndex, int lastShiftColumnIndex, int step) |
void |
shiftCellsRight(int firstShiftColumnIndex, int lastShiftColumnIndex, int step) |
public SXSSFRow(SXSSFSheet sheet)
public java.util.Iterator<Cell> allCellsIterator()
public boolean hasCustomHeight()
public int getOutlineLevel()
Row
getOutlineLevel
in interface
Row
(接口 Row 中的 getOutlineLevel)
public java.lang.Boolean getHidden()
public void setHidden(java.lang.Boolean hidden)
hidden
- row hidden state
(hidden - 行隐藏状态)
public java.lang.Boolean getCollapsed()
public void setCollapsed(java.lang.Boolean collapsed)
public java.util.Iterator<Cell> iterator()
iterator
in interface
java.lang.Iterable<Cell>
(接口 java.lang.Iterable 中的迭代器
public SXSSFCell createCell(int column)
The cell that is returned is a CellType.BLANK
. The type can be changed either through calling setCellValue
or setCellType
.
createCell
in interface
Row
(接口 Row 中的 createCell)
column
- - the column number this cell represents
(column - - 此单元格代表的列号)
java.lang.IllegalArgumentException
- if columnIndex < 0 or greater than the maximum number of supported columns (255 for *.xls, 1048576 for *.xlsx)
(java.lang.IllegalArgumentException - 如果 columnIndex < 0 或大于支持的最大列数(*.xls 为 255,*.xlsx 为 1048576))
public SXSSFCell createCell(int column, CellType type)
The cell that is returned is a CellType.BLANK
. The type can be changed either through calling setCellValue or setCellType.
createCell
in interface
Row
(接口 Row 中的 createCell)
column
- - the column number this cell represents
(column - - 此单元格代表的列号)
type
- - the cell's data type
(type - - 单元格的数据类型)
java.lang.IllegalArgumentException
- if columnIndex < 0 or greater than a maximum number of supported columns (255 for *.xls, 1048576 for *.xlsx)
(java.lang.IllegalArgumentException - 如果 columnIndex < 0 或大于支持的最大列数(*.xls 为 255,*.xlsx 为 1048576))
public void removeCell(Cell cell)
removeCell
in interface
Row
(接口 Row 中的 removeCell)
cell
- the cell to remove
(cell - 要删除的单元格)
public void setRowNum(int rowNum)
public int getRowNum()
public SXSSFCell getCell(int cellnum)
getCell
in interface
Row
(接口 Row 中的 getCell)
cellnum
- 0 based column number
(cellnum - 基于 0 的列号)
java.lang.RuntimeException
- if cellnum is out of bounds
(java.lang.RuntimeException - 如果 cellnum 超出范围)
getCell(int, org.apache.poi.ss.usermodel.Row.MissingCellPolicy)
public SXSSFCell getCell(int cellnum, Row.MissingCellPolicy policy)
Row.MissingCellPolicy
(返回给定(基于 0)索引处的单元格,具有指定的 Row.MissingCellPolicy)
getCell
in interface
Row
(接口 Row 中的 getCell)
java.lang.IllegalArgumentException
- if cellnum < 0 or the specified MissingCellPolicy is invalid
(java.lang.IllegalArgumentException - 如果 cellnum < 0 或指定的 MissingCellPolicy 无效)
public short getFirstCellNum()
getFirstCellNum
in interface
Row
(接口 Row 中的 getFirstCellNum)
public short getLastCellNum()
short minColIx = row.getFirstCellNum(); short maxColIx = row.getLastCellNum(); for(short colIx=minColIx; colIx<maxColIx; colIx++) { Cell cell = row.getCell(colIx); if(cell == null) { continue; } //... do something with cell }(获取此行 PLUS ONE 中包含的最后一个单元格的索引。结果也恰好是最后一个单元格的基于 1 的列号。迭代单元格时,此值可用作标准上限:short minColIx = row.getFirstCellNum();短 maxColIx = row.getLastCellNum();对于(短 colIx=minColIx;colIx
getLastCellNum
in interface
Row
(接口 Row 中的 getLastCellNum)
public int getPhysicalNumberOfCells()
getPhysicalNumberOfCells
in interface
Row
(接口 Row 中的 getPhysicalNumberOfCells)
public void setHeight(short height)
public void setZeroHeight(boolean zHeight)
setZeroHeight
in interface
Row
(接口 Row 中的 setZeroHeight)
zHeight
- height is zero or not.
(zHeight - 高度是否为零。)
public boolean getZeroHeight()
getZeroHeight
in interface
Row
(接口 Row 中的 getZeroHeight)
public void setHeightInPoints(float height)
setHeightInPoints
in interface
Row
(接口 Row 中的 setHeightInPoints)
height
- the height in points.
-1
resets to the default height
(height - 以磅为单位的高度。 -1 重置为默认高度)
public short getHeight()
Sheet.getDefaultRowHeightInPoints()
(获取以缇为单位的行高(1/20 点)。如果未设置高度,则返回默认工作表值,参见 Sheet.getDefaultRowHeightInPoints())
public float getHeightInPoints()
Sheet.getDefaultRowHeightInPoints()
(返回以磅为单位测量的行高。如果未设置高度,则返回默认工作表值,参见 Sheet.getDefaultRowHeightInPoints())
getHeightInPoints
in interface
Row
(接口 Row 中的 getHeightInPoints)
Sheet.getDefaultRowHeightInPoints()
public boolean isFormatted()
getRowStyle()
(此行是否已格式化?大多数不是,但有些行确实具有整行样式。对于那些这样做的人,您可以从 getRowStyle() 获取格式)
isFormatted
in interface
Row
(isFormatted 在接口 Row 中)
public CellStyle getRowStyle()
isFormatted()
to check first.
(返回整行单元格样式。大多数行不会有其中之一,因此将返回 null。首先调用 isFormatted() 进行检查。)
getRowStyle
in interface
Row
(接口 Row 中的 getRowStyle)
public void setRowStyle(CellStyle style)
null
.
(将整行单元格样式应用于行。可以通过传入 null 来清除行样式。)
setRowStyle
in interface
Row
(接口 Row 中的 setRowStyle)
public java.util.Iterator<Cell> cellIterator()
cellIterator
in interface
Row
(接口 Row 中的 cellIterator)
public SXSSFSheet getSheet()
public int compareTo(SXSSFRow other)
SXSSFRow
objects. Two rows are equal if they belong to the same worksheet and their row indexes are equal.
(比较两个 SXSSFRow 对象。如果两行属于同一个工作表并且它们的行索引相等,则它们是相等的。)
compareTo
in interface
java.lang.Comparable<SXSSFRow>
(接口 java.lang.Comparable 中的 compareTo
other
- the
SXSSFRow
to be compared.
(other - 要比较的 SXSSFRow。)
0
if the row number of this SXSSFRow
is equal to the row number of the argument SXSSFRow
0
if the row number of this this SXSSFRow
is numerically less than the row number of the argument SXSSFRow
0
if the row number of this this SXSSFRow
is numerically greater than the row number of the argument SXSSFRow
java.lang.IllegalArgumentException
- if the argument row belongs to a different worksheet
(java.lang.IllegalArgumentException - 如果参数行属于不同的工作表)
public boolean equals(java.lang.Object obj)
equals
in class
java.lang.Object
public int hashCode()
hashCode
in class
java.lang.Object
@NotImplemented public void shiftCellsRight(int firstShiftColumnIndex, int lastShiftColumnIndex, int step)
shiftCellsRight
in interface
Row
(界面 Row 中的 shiftCellsRight)
@NotImplemented public void shiftCellsLeft(int firstShiftColumnIndex, int lastShiftColumnIndex, int step)
shiftCellsLeft
in interface
Row
(接口 Row 中的 shiftCellsLeft)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.