org.apache.poi.xssf.usermodel.XSSFSheet.copyRows()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(1443)

本文整理了Java中org.apache.poi.xssf.usermodel.XSSFSheet.copyRows()方法的一些代码示例,展示了XSSFSheet.copyRows()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XSSFSheet.copyRows()方法的具体详情如下:
包路径:org.apache.poi.xssf.usermodel.XSSFSheet
类名称:XSSFSheet
方法名:copyRows

XSSFSheet.copyRows介绍

[英]Copies rows between srcStartRow and srcEndRow to the same sheet, starting at destStartRow Convenience function for #copyRows(List,int,CellCopyPolicy)Equivalent to copyRows(getRows(srcStartRow, srcEndRow, false), destStartRow, cellCopyPolicy)
[中]将srcStartRow和srcEndRow之间的行复制到同一工作表中,从destStartRow便利函数开始,用于#copyRows(List,int,CellCopyPolicy)等效于copyRows(getRows(srcStartRow,srcEndRow,false),destStartRow,CellCopyPolicy)

代码示例

代码示例来源:origin: org.apache.poi/poi-ooxml

/**
 * Copies rows between srcStartRow and srcEndRow to the same sheet, starting at destStartRow
 * Convenience function for {@link #copyRows(List, int, CellCopyPolicy)}
 *
 * Equivalent to copyRows(getRows(srcStartRow, srcEndRow, false), destStartRow, cellCopyPolicy)
 *
 * @param srcStartRow the index of the first row to copy the cells from in this sheet
 * @param srcEndRow the index of the last row to copy the cells from in this sheet
 * @param destStartRow the index of the first row to copy the cells to in this sheet
 * @param cellCopyPolicy the policy to use to determine how cells are copied
 */
@Beta
public void copyRows(int srcStartRow, int srcEndRow, int destStartRow, CellCopyPolicy cellCopyPolicy) {
  final List<XSSFRow> srcRows = getRows(srcStartRow, srcEndRow, false); //FIXME: should be false, no need to create rows where src is only to copy them to dest
  copyRows(srcRows, destStartRow, cellCopyPolicy);
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

/**
 * Copies rows between srcStartRow and srcEndRow to the same sheet, starting at destStartRow
 * Convenience function for {@link #copyRows(List, int, CellCopyPolicy)}
 *
 * Equivalent to copyRows(getRows(srcStartRow, srcEndRow, false), destStartRow, cellCopyPolicy)
 *
 * @param srcStartRow the index of the first row to copy the cells from in this sheet
 * @param srcEndRow the index of the last row to copy the cells from in this sheet
 * @param destStartRow the index of the first row to copy the cells to in this sheet
 * @param cellCopyPolicy the policy to use to determine how cells are copied
 */
@Beta
public void copyRows(int srcStartRow, int srcEndRow, int destStartRow, CellCopyPolicy cellCopyPolicy) {
  final List<XSSFRow> srcRows = getRows(srcStartRow, srcEndRow, false); //FIXME: should be false, no need to create rows where src is only to copy them to dest
  copyRows(srcRows, destStartRow, cellCopyPolicy);
}

相关文章

微信公众号

最新文章

更多

XSSFSheet类方法