Package me.saro.commons.excel
Class ExcelCell
- java.lang.Object
-
- me.saro.commons.excel.ExcelCell
-
public class ExcelCell extends java.lang.Object
-
-
Method Summary
Modifier and Type Method Description java.util.DategetDateValue(java.util.Date defaultValue)doublegetDoubleValue()doublegetDoubleValue(double defaultValue)floatgetFloatValue()floatgetFloatValue(float defaultValue)java.lang.StringgetIntegerStringValue(long defaultValue)intgetIntValue()intgetIntValue(int defaultValue)longgetLongValue()longgetLongValue(long defaultValue)ExcelCellgetNextCell()ExcelCellgetNextRowCell()org.apache.poi.ss.usermodel.CellgetPoiCell(boolean force)java.lang.StringgetStringValue()java.lang.StringgetStringValue(java.lang.String defaultValue)booleanisEmpty()ExcelCellset(java.lang.Object val)static inttoCellIndex(java.lang.String cellColumnName)to cell indexstatic java.lang.StringtoColumnName(int rowIndex, int cellIndex)to column namestatic java.lang.StringtoColumnNameByCellIndex(int cellIndex)static java.util.DatetoDate(org.apache.poi.ss.usermodel.Cell cell, java.util.Date defaultValue)toDate by cellstatic doubletoDouble(org.apache.poi.ss.usermodel.Cell cell)toDouble by cellstatic doubletoDouble(org.apache.poi.ss.usermodel.Cell cell, double defaultValue)toDouble by cellstatic int[]toRowCellIndex(java.lang.String columnName)to row cell indexstatic java.lang.StringtoString(org.apache.poi.ss.usermodel.Cell cell, java.lang.String defaultValue)toString by cell
-
-
-
Method Detail
-
getPoiCell
public org.apache.poi.ss.usermodel.Cell getPoiCell(boolean force)
-
isEmpty
public boolean isEmpty()
-
getNextCell
public ExcelCell getNextCell()
-
getNextRowCell
public ExcelCell getNextRowCell()
-
set
public ExcelCell set(java.lang.Object val)
-
getIntValue
public int getIntValue(int defaultValue)
-
getLongValue
public long getLongValue(long defaultValue)
-
getFloatValue
public float getFloatValue(float defaultValue)
-
getDoubleValue
public double getDoubleValue(double defaultValue)
-
getIntValue
public int getIntValue()
-
getLongValue
public long getLongValue()
-
getFloatValue
public float getFloatValue()
-
getDoubleValue
public double getDoubleValue()
-
getDateValue
public java.util.Date getDateValue(java.util.Date defaultValue)
-
getIntegerStringValue
public java.lang.String getIntegerStringValue(long defaultValue)
-
getStringValue
public java.lang.String getStringValue(java.lang.String defaultValue)
-
getStringValue
public java.lang.String getStringValue()
-
toDouble
public static double toDouble(org.apache.poi.ss.usermodel.Cell cell, double defaultValue)toDouble by cell- Parameters:
cell-defaultValue-- Returns:
-
toDouble
public static double toDouble(org.apache.poi.ss.usermodel.Cell cell)
toDouble by cell- Parameters:
cell-defaultValue-- Returns:
-
toDate
public static java.util.Date toDate(org.apache.poi.ss.usermodel.Cell cell, java.util.Date defaultValue)toDate by cell- Parameters:
cell-defaultValue-- Returns:
-
toString
public static java.lang.String toString(org.apache.poi.ss.usermodel.Cell cell, java.lang.String defaultValue)toString by cell- Parameters:
cell-defaultValue-- Returns:
- BOOLEAN [1, 0]
FORMULA -> String
NUMERIC -> Double.toString
STRING -> String
ETC -> defaultValue
-
toColumnNameByCellIndex
public static java.lang.String toColumnNameByCellIndex(int cellIndex)
-
toColumnName
public static java.lang.String toColumnName(int rowIndex, int cellIndex)to column name- Parameters:
rowIndex-cellIndex-- Returns:
-
toCellIndex
public static int toCellIndex(java.lang.String cellColumnName)
to cell index- Parameters:
cellColumnName-- Returns:
-
toRowCellIndex
public static int[] toRowCellIndex(java.lang.String columnName)
to row cell index- Parameters:
columnName-- Returns:
- int[]{rowIndex, cellIndex}
-
-