org.apache.poi.hssf.usermodel.HSSFSheet.validateArrayFormulas()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(4.3k)|赞(0)|评价(0)|浏览(124)

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

HSSFSheet.validateArrayFormulas介绍

暂无

代码示例

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

/**
 * Verify that none of the merged regions intersect a multi-cell array formula in this sheet
 *
 * @throws IllegalStateException if candidate region intersects an existing array formula in this sheet
 */
private void checkForMergedRegionsIntersectingArrayFormulas() {
  for (CellRangeAddress region : getMergedRegions()) {
    validateArrayFormulas(region);
  }
}

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

/**
 * adds a merged region of cells (hence those cells form one)
 *
 * @param region (rowfrom/colfrom-rowto/colto) to merge
 * @param validate whether to validate merged region
 * @return index of this region
 * @throws IllegalArgumentException if region contains fewer than 2 cells
 * @throws IllegalStateException if region intersects with an existing merged region
 * or multi-cell array formula on this sheet
 */
private int addMergedRegion(CellRangeAddress region, boolean validate) {
  if (region.getNumberOfCells() < 2) {
    throw new IllegalArgumentException("Merged region " + region.formatAsString() + " must contain 2 or more cells");
  }
  region.validate(SpreadsheetVersion.EXCEL97);
  if (validate) {
    // throw IllegalStateException if the argument CellRangeAddress intersects with
    // a multi-cell array formula defined in this sheet
    validateArrayFormulas(region);
  
    // Throw IllegalStateException if the argument CellRangeAddress intersects with
    // a merged region already in this sheet
    validateMergedRegions(region);
  }
  return _sheet.addMergedRegion(region.getFirstRow(),
      region.getFirstColumn(),
      region.getLastRow(),
      region.getLastColumn());
}

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

/**
 * Verify that none of the merged regions intersect a multi-cell array formula in this sheet
 *
 * @throws IllegalStateException if candidate region intersects an existing array formula in this sheet
 */
private void checkForMergedRegionsIntersectingArrayFormulas() {
  for (CellRangeAddress region : getMergedRegions()) {
    validateArrayFormulas(region);
  }
}

代码示例来源:origin: com.haulmont.thirdparty/poi

/**
 * adds a merged region of cells (hence those cells form one)
 *
 * @param region (rowfrom/colfrom-rowto/colto) to merge
 * @return index of this region
 */
public int addMergedRegion(CellRangeAddress region) {
  region.validate(SpreadsheetVersion.EXCEL97);
  // throw IllegalStateException if the argument CellRangeAddress intersects with
  // a multi-cell array formula defined in this sheet
  validateArrayFormulas(region);
  return _sheet.addMergedRegion(region.getFirstRow(),
      region.getFirstColumn(),
      region.getLastRow(),
      region.getLastColumn());
}

代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev

/**
 * adds a merged region of cells (hence those cells form one)
 * @param region (rowfrom/colfrom-rowto/colto) to merge
 * @return index of this region
 */
public int addMergedRegion(CellRangeAddress region)
{
  region.validate(SpreadsheetVersion.EXCEL97);
  // throw IllegalStateException if the argument CellRangeAddress intersects with
  // a multi-cell array formula defined in this sheet
  validateArrayFormulas(region);
  return _sheet.addMergedRegion( region.getFirstRow(),
      region.getFirstColumn(),
      region.getLastRow(),
      region.getLastColumn());
}

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

/**
 * adds a merged region of cells (hence those cells form one)
 *
 * @param region (rowfrom/colfrom-rowto/colto) to merge
 * @param validate whether to validate merged region
 * @return index of this region
 * @throws IllegalArgumentException if region contains fewer than 2 cells
 * @throws IllegalStateException if region intersects with an existing merged region
 * or multi-cell array formula on this sheet
 */
private int addMergedRegion(CellRangeAddress region, boolean validate) {
  if (region.getNumberOfCells() < 2) {
    throw new IllegalArgumentException("Merged region " + region.formatAsString() + " must contain 2 or more cells");
  }
  region.validate(SpreadsheetVersion.EXCEL97);
  if (validate) {
    // throw IllegalStateException if the argument CellRangeAddress intersects with
    // a multi-cell array formula defined in this sheet
    validateArrayFormulas(region);
  
    // Throw IllegalStateException if the argument CellRangeAddress intersects with
    // a merged region already in this sheet
    validateMergedRegions(region);
  }
  return _sheet.addMergedRegion(region.getFirstRow(),
      region.getFirstColumn(),
      region.getLastRow(),
      region.getLastColumn());
}

相关文章

微信公众号

最新文章

更多

HSSFSheet类方法