本文整理汇总了Java中org.apache.poi.ss.usermodel.Row.MissingCellPolicy类的典型用法代码示例。如果您正苦于以下问题:Java MissingCellPolicy类的具体用法?Java MissingCellPolicy怎么用?Java MissingCellPolicy使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MissingCellPolicy类属于org.apache.poi.ss.usermodel.Row包,在下文中一共展示了MissingCellPolicy类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: readRow
import org.apache.poi.ss.usermodel.Row.MissingCellPolicy; //导入依赖的package包/类
@Override
public IRow readRow() {
SheetData vData = getLocalData();
int vRowIndex = vData.getCurrentIndex();
if (vRowIndex < vData.getRowCount()) {
Row vRow = vData.getSheet().getRow(vRowIndex);
String[] vTitles = vData.getTitles();
Cell[] vValues = new Cell[vTitles.length];
for (int i = 0; i < vTitles.length; ++i) {
Cell vCell = vRow.getCell(i, MissingCellPolicy.CREATE_NULL_AS_BLANK);
vValues[i] = vCell;
}
vData.setCurrentIndex(vRowIndex + 1);
return new RowExcelImpl(vRowIndex, vTitles, vValues);
}
// read over, remove the local data
removeLocalData();
return null;
}
开发者ID:xinufo,项目名称:teemo,代码行数:20,代码来源:ExcelReader.java
示例2: setCellValue
import org.apache.poi.ss.usermodel.Row.MissingCellPolicy; //导入依赖的package包/类
private void setCellValue(final Object value, final int columnIndex) {
Cell cell = currentExcelRow.getCell(
sheetConfig.columnOrigin() + columnIndex,
MissingCellPolicy.CREATE_NULL_AS_BLANK
);
sheetConfig.cellStyler().style(cell);
if(value == null) {
return;
}
// numbers
if (value instanceof Integer) {
cell.setCellValue(Double.valueOf(((Integer) value).intValue()));
} else if (value instanceof Long) {
cell.setCellValue(Double.valueOf(((Long) value).longValue()));
} else if (value instanceof Float) {
cell.setCellValue(Double.valueOf(((Float) value).floatValue()));
} else if (value instanceof BigDecimal) {
cell.setCellValue(((BigDecimal) value).doubleValue());
} else if (value instanceof Double) {
cell.setCellValue((Double) value);
}
// other types
else if (value instanceof Boolean) {
cell.setCellValue(((Boolean) value).booleanValue());
} else if (value instanceof Calendar) {
cell.setCellValue((Calendar) value);
} else if (value instanceof Date) {
cell.setCellValue((Date) value);
} else if (value instanceof String) {
cell.setCellValue((String) value);
}
else {
cell.setCellValue(value.toString());
}
}
开发者ID:Coreoz,项目名称:Windmill,代码行数:39,代码来源:ExcelExporter.java
示例3: getCell
import org.apache.poi.ss.usermodel.Row.MissingCellPolicy; //导入依赖的package包/类
@Override
public PoiCell getCell(int col) {
org.apache.poi.ss.usermodel.Cell poiCell = poiRow.getCell(col, MissingCellPolicy.CREATE_NULL_AS_BLANK);
return new PoiCell(this, poiCell);
}
开发者ID:xzel23,项目名称:meja,代码行数:6,代码来源:PoiRow.java
示例4: getMissingCellPolicy
import org.apache.poi.ss.usermodel.Row.MissingCellPolicy; //导入依赖的package包/类
/**
* Not supported
*/
@Override
public MissingCellPolicy getMissingCellPolicy() {
throw new UnsupportedOperationException();
}
开发者ID:Talend,项目名称:data-prep,代码行数:8,代码来源:StreamingWorkbook.java
示例5: setMissingCellPolicy
import org.apache.poi.ss.usermodel.Row.MissingCellPolicy; //导入依赖的package包/类
/**
* Not supported
*/
@Override
public void setMissingCellPolicy(MissingCellPolicy missingCellPolicy) {
throw new UnsupportedOperationException();
}
开发者ID:Talend,项目名称:data-prep,代码行数:8,代码来源:StreamingWorkbook.java
示例6: getMissingCellPolicy
import org.apache.poi.ss.usermodel.Row.MissingCellPolicy; //导入依赖的package包/类
/**
* Not supported
*/
@Override
public MissingCellPolicy getMissingCellPolicy() {
throw new UnsupportedOperationException();
}
开发者ID:monitorjbl,项目名称:excel-streaming-reader,代码行数:8,代码来源:StreamingWorkbook.java
示例7: setMissingCellPolicy
import org.apache.poi.ss.usermodel.Row.MissingCellPolicy; //导入依赖的package包/类
/**
* Not supported
*/
@Override
public void setMissingCellPolicy(MissingCellPolicy missingCellPolicy) {
throw new UnsupportedOperationException();
}
开发者ID:monitorjbl,项目名称:excel-streaming-reader,代码行数:8,代码来源:StreamingWorkbook.java
示例8: getCell
import org.apache.poi.ss.usermodel.Row.MissingCellPolicy; //导入依赖的package包/类
public static Cell getCell(Row row, int col, MissingCellPolicy mcp) {
if (row == null) {
return null;
}
return row.getCell(col, mcp);
}
开发者ID:brightgenerous,项目名称:brigen-base,代码行数:7,代码来源:PoiMethods.java
注:本文中的org.apache.poi.ss.usermodel.Row.MissingCellPolicy类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论