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

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

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

HSSFSheet.getMergedRegions介绍

暂无

代码示例

代码示例来源: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

/**
 * Verify that no merged regions intersect another merged region in this sheet.
 *
 * @throws IllegalStateException if at least one region intersects with another merged region in this sheet
 */
private void checkForIntersectingMergedRegions() {
  final List<CellRangeAddress> regions = getMergedRegions();
  final int size = regions.size();
  for (int i=0; i < size; i++) {
    final CellRangeAddress region = regions.get(i);
    for (final CellRangeAddress other : regions.subList(i+1, regions.size())) {
      if (region.intersects(other)) {
        String msg = "The range " + region.formatAsString() +
              " intersects with another merged region " +
              other.formatAsString() + " in this sheet";
        throw new IllegalStateException(msg);
      }
    }
  }
}

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

private void validateMergedRegions(CellRangeAddress candidateRegion) {
  for (final CellRangeAddress existingRegion : getMergedRegions()) {
    if (existingRegion.intersects(candidateRegion)) {
      throw new IllegalStateException("Cannot add merged region " + candidateRegion.formatAsString() +
          " to sheet because it overlaps with an existing merged region (" + existingRegion.formatAsString() + ").");
    }
  }
}

代码示例来源: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: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

/**
 * Verify that no merged regions intersect another merged region in this sheet.
 *
 * @throws IllegalStateException if at least one region intersects with another merged region in this sheet
 */
private void checkForIntersectingMergedRegions() {
  final List<CellRangeAddress> regions = getMergedRegions();
  final int size = regions.size();
  for (int i=0; i < size; i++) {
    final CellRangeAddress region = regions.get(i);
    for (final CellRangeAddress other : regions.subList(i+1, regions.size())) {
      if (region.intersects(other)) {
        String msg = "The range " + region.formatAsString() +
              " intersects with another merged region " +
              other.formatAsString() + " in this sheet";
        throw new IllegalStateException(msg);
      }
    }
  }
}

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

private void validateMergedRegions(CellRangeAddress candidateRegion) {
  for (final CellRangeAddress existingRegion : getMergedRegions()) {
    if (existingRegion.intersects(candidateRegion)) {
      throw new IllegalStateException("Cannot add merged region " + candidateRegion.formatAsString() +
          " to sheet because it overlaps with an existing merged region (" + existingRegion.formatAsString() + ").");
    }
  }
}

相关文章

微信公众号

最新文章

更多

HSSFSheet类方法