| 限定符和类型 | 字段和说明 |
|---|---|
protected Cell[] |
cells |
protected int |
fc |
protected HeaderRow |
hr |
protected int |
index |
protected int |
lc |
protected org.slf4j.Logger |
LOGGER |
protected SharedStrings |
sst
The Shared String Table
|
protected Styles |
styles
The global styles
|
protected boolean |
unknownLength |
| 构造器和说明 |
|---|
Row() |
| 限定符和类型 | 方法和说明 |
|---|---|
HeaderRow |
asHeader()
convert row to header_row
|
Cell[] |
copyCells()
Returns deep clone cells
|
Cell[] |
copyCells(int newLength)
Returns deep clone cells
|
<T> T |
geet()
Returns the binding type if is bound, otherwise returns Row
|
<T> T |
get()
Returns the binding type if is bound, otherwise returns Row
|
Boolean |
getBoolean(Cell c)
Get
Boolean value |
Boolean |
getBoolean(int columnIndex)
Get
Boolean value by column index |
Boolean |
getBoolean(String columnName)
Get
Boolean value by column name |
Byte |
getByte(Cell c)
Get
Byte value |
Byte |
getByte(int columnIndex)
Get
Byte value by column index |
Byte |
getByte(String columnName)
Get
Byte value by column name |
Cell |
getCell(int i)
Returns
Cell |
Cell |
getCell(String name)
Search
Cell by column name |
int |
getCellStyle(Cell c)
Returns the cell styles
|
int |
getCellStyle(int columnIndex)
Returns the cell styles
|
int |
getCellStyle(String columnName)
Returns the cell styles
|
CellType |
getCellType(Cell c)
Returns the type of cell
|
CellType |
getCellType(int columnIndex)
Returns the type of cell
|
CellType |
getCellType(String columnName)
Returns the type of cell
|
Character |
getChar(Cell c)
Get
Character value |
Character |
getChar(int columnIndex)
Get
Character value by column index |
Character |
getChar(String columnName)
Get
Character value by column name |
Date |
getDate(Cell c)
Get
Date value |
Date |
getDate(int columnIndex)
Get
Date value by column index |
Date |
getDate(String columnName)
Get
Date value by column name |
BigDecimal |
getDecimal(Cell c)
Get
BigDecimal value |
BigDecimal |
getDecimal(int columnIndex)
Get
BigDecimal value by column index |
BigDecimal |
getDecimal(String columnName)
Get
BigDecimal value by column name |
Double |
getDouble(Cell c)
Get
Double value |
Double |
getDouble(int columnIndex)
Get
Double value by column index |
Double |
getDouble(String columnName)
Get
Double value by column name |
int |
getFirstColumnIndex()
Returns the index of the first column (zero base)
|
Float |
getFloat(Cell c)
Get
Float value by cell |
Float |
getFloat(int columnIndex)
Get
Float value by column index |
Float |
getFloat(String columnName)
Get
Float value by column index |
String |
getFormula(int columnIndex)
Returns formula if exists
|
String |
getFormula(String columnName)
Returns formula if exists
|
Integer |
getInt(Cell c)
Get
Integer value |
Integer |
getInt(int columnIndex)
Get
Integer value by column index |
Integer |
getInt(String columnName)
Get
Integer value by column name |
int |
getLastColumnIndex()
Returns the index of the last column (zero base, exclude).
|
LocalDate |
getLocalDate(Cell c)
Get
LocalDate value |
LocalDate |
getLocalDate(int columnIndex)
Get
LocalDate value by column index |
LocalDate |
getLocalDate(String columnName)
Get
LocalDate value by column name |
LocalDateTime |
getLocalDateTime(Cell c)
Get
LocalDateTime value |
LocalDateTime |
getLocalDateTime(int columnIndex)
Get
LocalDateTime value by column index |
LocalDateTime |
getLocalDateTime(String columnName)
Get
LocalDateTime value by column name |
LocalTime |
getLocalTime(Cell c)
Get
LocalTime value |
LocalTime |
getLocalTime(int columnIndex)
Get
LocalTime value by column index |
LocalTime |
getLocalTime(String columnName)
Get
LocalTime value by column name |
Long |
getLong(Cell c)
Get
Long value |
Long |
getLong(int columnIndex)
Get
Long value by column index |
Long |
getLong(String columnName)
Get
Long value by column name |
int |
getRowNum()
The number of row.
|
Short |
getShort(Cell c)
Get
Short value |
Short |
getShort(int columnIndex)
Get
Short value by column index |
Short |
getShort(String columnName)
Get
Short value by column name |
String |
getString(Cell c)
Get string value
|
String |
getString(int columnIndex)
Get string value by column index
|
String |
getString(String columnName)
Get string value by column name
|
Styles |
getStyles()
Returns a global
Styles |
Time |
getTime(Cell c)
Get
Time value by column name |
Time |
getTime(int columnIndex)
Get
Time value by column index |
Time |
getTime(String columnName)
Get
Time value by column name |
Timestamp |
getTimestamp(Cell c)
Get
Timestamp value |
Timestamp |
getTimestamp(int columnIndex)
Get
Timestamp value by column index |
Timestamp |
getTimestamp(String columnName)
Get
Timestamp value by column name |
boolean |
hasFormula(int columnIndex)
Check cell has formula
|
boolean |
hasFormula(String columnName)
Check cell has formula
|
boolean |
isBlank()
Tests the value of all cells is null or whitespace
|
boolean |
isBlank(Cell c)
Tests the specify cell value is blank
|
boolean |
isBlank(int columnIndex)
Tests the specify cell value is blank
|
boolean |
isBlank(String columnName)
Tests the specify cell value is blank
|
boolean |
isEmpty()
Test unused row (not contains any filled, formatted, border, value or other styles)
|
boolean |
nonBlank()
Returns
true if any cell in row contains values
otherwise returns false. |
boolean |
nonEmpty()
Returns
true if any cell in row contains filled, formatted, border, value or other styles
otherwise returns false. |
protected void |
rangeCheck(int index)
Check the cell ranges,
|
Row |
setCells(Cell[] cells)
Setting custom
Cell |
Row |
setCells(Cell[] cells,
int fromIndex,
int toIndex)
Setting custom
Cell |
Row |
setHr(HeaderRow hr)
Setting header row
|
<T> T |
to(Class<T> clazz)
Convert to object, support annotation
|
static int |
toCellIndex(char[] cb,
int a,
int b)
Convert to column index
|
Map<String,Object> |
toMap()
Convert row data to LinkedMap(sort by column index)
|
<T> T |
too(Class<T> clazz)
Convert to T object, support annotation
the is a memory shared object
|
String |
toString() |
protected final org.slf4j.Logger LOGGER
protected int index
protected int fc
protected int lc
protected Cell[] cells
protected SharedStrings sst
protected HeaderRow hr
protected boolean unknownLength
protected Styles styles
public int getRowNum()
public int getFirstColumnIndex()
public int getLastColumnIndex()
public boolean isEmpty()
public boolean nonEmpty()
true if any cell in row contains filled, formatted, border, value or other styles
otherwise returns false.
This method exists to be used as a
Predicate, filter(Row::nonEmpty)public boolean isBlank()
public boolean nonBlank()
true if any cell in row contains values
otherwise returns false.
This method exists to be used as a
Predicate, filter(Row::nonBlank)protected void rangeCheck(int index)
index - the indexIndexOutOfBoundsException - If the specified index
argument is negativepublic Cell getCell(String name)
Cell by column namename - the column nameCellpublic HeaderRow asHeader()
public Boolean getBoolean(int columnIndex)
Boolean value by column indexcolumnIndex - the cell indexBooleanpublic Boolean getBoolean(String columnName)
Boolean value by column namecolumnName - the cell nameBooleanpublic Byte getByte(int columnIndex)
Byte value by column indexcolumnIndex - the cell indexBytepublic Byte getByte(String columnName)
Byte value by column namecolumnName - the cell nameBytepublic Character getChar(int columnIndex)
Character value by column indexcolumnIndex - the cell indexCharacterpublic Character getChar(String columnName)
Character value by column namecolumnName - the cell nameCharacterpublic Short getShort(int columnIndex)
Short value by column indexcolumnIndex - the cell indexShortpublic Short getShort(String columnName)
Short value by column namecolumnName - the cell nameShortpublic Integer getInt(int columnIndex)
Integer value by column indexcolumnIndex - the cell indexIntegerpublic Integer getInt(String columnName)
Integer value by column namecolumnName - the cell nameIntegerpublic Long getLong(int columnIndex)
Long value by column indexcolumnIndex - the cell indexLongpublic Long getLong(String columnName)
Long value by column namecolumnName - the cell nameLongpublic String getString(int columnIndex)
columnIndex - the cell indexpublic String getString(String columnName)
columnName - the cell namepublic Float getFloat(int columnIndex)
Float value by column indexcolumnIndex - the cell indexFloatpublic Float getFloat(String columnName)
Float value by column indexcolumnName - the cell indexFloatpublic Double getDouble(int columnIndex)
Double value by column indexcolumnIndex - the cell indexDoublepublic Double getDouble(String columnName)
Double value by column namecolumnName - the cell nameDoublepublic BigDecimal getDecimal(int columnIndex)
BigDecimal value by column indexcolumnIndex - the cell indexpublic BigDecimal getDecimal(String columnName)
BigDecimal value by column namecolumnName - the cell namepublic BigDecimal getDecimal(Cell c)
BigDecimal valuec - the Cellpublic Date getDate(int columnIndex)
Date value by column indexcolumnIndex - the cell indexpublic Date getDate(String columnName)
Date value by column namecolumnName - the cell namepublic Timestamp getTimestamp(int columnIndex)
Timestamp value by column indexcolumnIndex - the cell indexpublic Timestamp getTimestamp(String columnName)
Timestamp value by column namecolumnName - the cell namepublic Timestamp getTimestamp(Cell c)
Timestamp valuec - the Cellpublic Time getTime(int columnIndex)
Time value by column indexcolumnIndex - the cell indexpublic Time getTime(String columnName)
Time value by column namecolumnName - the cell namepublic Time getTime(Cell c)
Time value by column namec - the Cellpublic LocalDateTime getLocalDateTime(int columnIndex)
LocalDateTime value by column indexcolumnIndex - the cell indexpublic LocalDateTime getLocalDateTime(String columnName)
LocalDateTime value by column namecolumnName - the cell namepublic LocalDateTime getLocalDateTime(Cell c)
LocalDateTime valuec - the Cellpublic LocalDate getLocalDate(int columnIndex)
LocalDate value by column indexcolumnIndex - the cell indexpublic LocalDate getLocalDate(String columnName)
LocalDate value by column namecolumnName - the cell namepublic LocalDate getLocalDate(Cell c)
LocalDate valuec - the Cellpublic LocalTime getLocalTime(int columnIndex)
LocalTime value by column indexcolumnIndex - the cell indexpublic LocalTime getLocalTime(String columnName)
LocalTime value by column namecolumnName - the cell namepublic LocalTime getLocalTime(Cell c)
LocalTime valuec - the Cellpublic String getFormula(int columnIndex)
columnIndex - the cell indexpublic String getFormula(String columnName)
columnName - the cell namepublic boolean hasFormula(int columnIndex)
columnIndex - the cell indexpublic boolean hasFormula(String columnName)
columnName - the cell namepublic CellType getCellType(int columnIndex)
columnIndex - the cell index from zeroCellTypepublic CellType getCellType(String columnName)
columnName - the cell nameCellTypepublic int getCellStyle(int columnIndex)
columnIndex - the cell index from zeropublic int getCellStyle(String columnName)
columnName - the cell namepublic int getCellStyle(Cell c)
c - the Cellpublic boolean isBlank(int columnIndex)
columnIndex - the cell indexpublic boolean isBlank(String columnName)
columnName - the cell namepublic boolean isBlank(Cell c)
c - the Cellpublic <T> T get()
T - the type of bindingpublic <T> T geet()
T - the type of bindingpublic <T> T to(Class<T> clazz)
T - the type of return objectclazz - the type of bindingpublic <T> T too(Class<T> clazz)
T - the type of return objectclazz - the type of bindingpublic Map<String,Object> toMap()
public Cell[] copyCells()
public Cell[] copyCells(int newLength)
newLength - the length of the copy to be returnedpublic Row setCells(Cell[] cells)
Cellcells - row cellspublic Row setCells(Cell[] cells, int fromIndex, int toIndex)
Cellcells - row cellsfromIndex - specify the first cells index(one base)toIndex - specify the last cells index(one base)public static int toCellIndex(char[] cb,
int a,
int b)
cb - character buffera - the start indexb - the end indexCopyright © 2023. All rights reserved.