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

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

本文整理了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

  1. /**
  2. * Verify that none of the merged regions intersect a multi-cell array formula in this sheet
  3. *
  4. * @throws IllegalStateException if candidate region intersects an existing array formula in this sheet
  5. */
  6. private void checkForMergedRegionsIntersectingArrayFormulas() {
  7. for (CellRangeAddress region : getMergedRegions()) {
  8. validateArrayFormulas(region);
  9. }
  10. }

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

  1. /**
  2. * Verify that no merged regions intersect another merged region in this sheet.
  3. *
  4. * @throws IllegalStateException if at least one region intersects with another merged region in this sheet
  5. */
  6. private void checkForIntersectingMergedRegions() {
  7. final List<CellRangeAddress> regions = getMergedRegions();
  8. final int size = regions.size();
  9. for (int i=0; i < size; i++) {
  10. final CellRangeAddress region = regions.get(i);
  11. for (final CellRangeAddress other : regions.subList(i+1, regions.size())) {
  12. if (region.intersects(other)) {
  13. String msg = "The range " + region.formatAsString() +
  14. " intersects with another merged region " +
  15. other.formatAsString() + " in this sheet";
  16. throw new IllegalStateException(msg);
  17. }
  18. }
  19. }
  20. }

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

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

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

  1. /**
  2. * Verify that none of the merged regions intersect a multi-cell array formula in this sheet
  3. *
  4. * @throws IllegalStateException if candidate region intersects an existing array formula in this sheet
  5. */
  6. private void checkForMergedRegionsIntersectingArrayFormulas() {
  7. for (CellRangeAddress region : getMergedRegions()) {
  8. validateArrayFormulas(region);
  9. }
  10. }

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

  1. /**
  2. * Verify that no merged regions intersect another merged region in this sheet.
  3. *
  4. * @throws IllegalStateException if at least one region intersects with another merged region in this sheet
  5. */
  6. private void checkForIntersectingMergedRegions() {
  7. final List<CellRangeAddress> regions = getMergedRegions();
  8. final int size = regions.size();
  9. for (int i=0; i < size; i++) {
  10. final CellRangeAddress region = regions.get(i);
  11. for (final CellRangeAddress other : regions.subList(i+1, regions.size())) {
  12. if (region.intersects(other)) {
  13. String msg = "The range " + region.formatAsString() +
  14. " intersects with another merged region " +
  15. other.formatAsString() + " in this sheet";
  16. throw new IllegalStateException(msg);
  17. }
  18. }
  19. }
  20. }

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

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

相关文章

HSSFSheet类方法