Class StandardFunction

java.lang.Object
overit.geocall.basic.ui.xlsx.StandardFunction

public class StandardFunction extends Object
This class implements a series of functions that allow to manage cells and formulas of a sheet.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
    static final char
     
    static final char
     
    static final char
     
    static final char
    Creates a new instance of StandardFunction
    static final String
     
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    decodeFunction(String function, int startRow, int startCol, int size)
     
    static String
    decodeFunction(String function, int startRow, int startCol, int endRow, int endCol)
    Takes a function in input and decode it.
    For example, if function is equal to "Sum" and refer to an area that is B2:B5, it will be decode with 'SUM(B2:B5)'.
    static org.apache.poi.ss.usermodel.Cell
    getEndFormula(org.apache.poi.ss.usermodel.Sheet sheet, String function, int startRow, int startCol, int endRow, int endCol)
    Gets a Cell containing a formula or and empty cell, if the function is null.
    If into the function there is a '#currow', willl be replace with endRow+1
    static org.apache.poi.ss.usermodel.Cell
    getFormula(org.apache.poi.ss.usermodel.Sheet sheet, String function, int startRow, int startCol, int size)
     
    static org.apache.poi.ss.usermodel.Cell
    getFormula(org.apache.poi.ss.usermodel.Sheet sheet, String function, int startRow, int startCol, int endRow, int endCol)
    Gets a Cell containing a function or and empty cell, if the function is null.
    static void
    main(String[] args)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • StandardFunction

      public StandardFunction()
  • Method Details

    • decodeFunction

      public static String decodeFunction(String function, int startRow, int startCol, int size)
    • getFormula

      public static org.apache.poi.ss.usermodel.Cell getFormula(org.apache.poi.ss.usermodel.Sheet sheet, String function, int startRow, int startCol, int endRow, int endCol)
      Gets a Cell containing a function or and empty cell, if the function is null.
      Parameters:
      sheet - The sheet
      function - The function to insert in the cell
      startRow - The start row of the area
      startCol - The start column of the area
      endRow - The end row of the area
      endCol - The end column of the area
      Returns:
      A Cell containing a function or and empty cell, if the function is null.
    • getEndFormula

      public static org.apache.poi.ss.usermodel.Cell getEndFormula(org.apache.poi.ss.usermodel.Sheet sheet, String function, int startRow, int startCol, int endRow, int endCol)
      Gets a Cell containing a formula or and empty cell, if the function is null.
      If into the function there is a '#currow', willl be replace with endRow+1
      Parameters:
      sheet - The sheet
      function - The function to insert in the cell
      startRow - The start row of the area
      startCol - The start column of the area
      endRow - The end row of the area
      endCol - The end column of the arear
      Returns:
      A Cell containing a formula or and empty cell, if the function is null.
    • getFormula

      public static org.apache.poi.ss.usermodel.Cell getFormula(org.apache.poi.ss.usermodel.Sheet sheet, String function, int startRow, int startCol, int size)
    • decodeFunction

      public static String decodeFunction(String function, int startRow, int startCol, int endRow, int endCol)
      Takes a function in input and decode it.
      For example, if function is equal to "Sum" and refer to an area that is B2:B5, it will be decode with 'SUM(B2:B5)'.
      Parameters:
      function - The function to decode
      startRow - The start row of the area to which the function refers
      startCol - The start column of the area to which the function refers
      endRow - The end row of the area to which the function refers
      endCol - The end column of the area to which the function refers
      Returns:
      The function decoded.
    • main

      public static void main(String[] args)