Class RangeCopier

java.lang.Object
org.apache.poi.ss.usermodel.RangeCopier
Direct Known Subclasses:
HSSFRangeCopier, XSSFRangeCopier

@Beta public abstract class RangeCopier extends Object
  • Constructor Details

    • RangeCopier

      public RangeCopier(Sheet sourceSheet, Sheet destSheet)
    • RangeCopier

      public RangeCopier(Sheet sheet)
  • Method Details

    • copyRange

      public void copyRange(CellRangeAddress tilePatternRange, CellRangeAddress tileDestRange)
      Uses input pattern to tile destination region, overwriting existing content. Works in following manner : 1.Start from top-left of destination. 2.Paste source but only inside of destination borders. 3.If there is space left on right or bottom side of copy, process it as in step 2.
      Parameters:
      tilePatternRange - source range which should be copied in tiled manner
      tileDestRange - destination range, which should be overridden
    • copyRange

      public void copyRange(CellRangeAddress tilePatternRange, CellRangeAddress tileDestRange, boolean copyStyles, boolean copyMergedRanges)
      Uses input pattern to tile destination region, overwriting existing content. Works in following manner :
      1. Start from top-left of destination.
      2. Paste source but only inside of destination borders.
      3. If there is space left on right or bottom side of copy, process it as in step 2.
      Parameters:
      tilePatternRange - source range which should be copied in tiled manner
      tileDestRange - destination range, which should be overridden
      copyStyles - whether to copy the cell styles
      copyMergedRanges - whether to copy merged ranges
      Since:
      5.0.0
    • adjustCellReferencesInsideFormula

      protected abstract void adjustCellReferencesInsideFormula(Cell cell, Sheet destSheet, int deltaX, int deltaY)
    • adjustInBothDirections

      protected boolean adjustInBothDirections(Ptg[] ptgs, int sheetIndex, int deltaX, int deltaY)
    • cloneCellContent

      public static void cloneCellContent(Cell srcCell, Cell destCell, Map<Integer,CellStyle> styleMap)