Class FormulaShifter


  • public final class FormulaShifter
    extends java.lang.Object
    Updates Formulas as rows or sheets are shifted
    • Method Detail

      • createForRowShift

        public static FormulaShifter createForRowShift​(int externSheetIndex,
                                                       java.lang.String sheetName,
                                                       int firstMovedRowIndex,
                                                       int lastMovedRowIndex,
                                                       int numberOfRowsToMove,
                                                       SpreadsheetVersion version)
      • createForRowCopy

        public static FormulaShifter createForRowCopy​(int externSheetIndex,
                                                      java.lang.String sheetName,
                                                      int firstMovedRowIndex,
                                                      int lastMovedRowIndex,
                                                      int numberOfRowsToMove,
                                                      SpreadsheetVersion version)
      • createForColumnShift

        public static FormulaShifter createForColumnShift​(int externSheetIndex,
                                                          java.lang.String sheetName,
                                                          int firstMovedColumnIndex,
                                                          int lastMovedColumnIndex,
                                                          int numberOfColumnsToMove,
                                                          SpreadsheetVersion version)
        Since:
        POI 4.0.0
      • createForColumnCopy

        public static FormulaShifter createForColumnCopy​(int externSheetIndex,
                                                         java.lang.String sheetName,
                                                         int firstMovedColumnIndex,
                                                         int lastMovedColumnIndex,
                                                         int numberOfColumnsToMove,
                                                         SpreadsheetVersion version)
        Since:
        POI 4.0.0
      • createForSheetShift

        public static FormulaShifter createForSheetShift​(int srcSheetIndex,
                                                         int dstSheetIndex)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • adjustFormula

        public boolean adjustFormula​(Ptg[] ptgs,
                                     int currentExternSheetIx)
        Parameters:
        ptgs - - if necessary, will get modified by this method
        currentExternSheetIx - - the extern sheet index of the sheet that contains the formula being adjusted
        Returns:
        true if a change was made to the formula tokens