Package overit.geocall.basic.ui.xlsx
Class StandardFunction
java.lang.Object
overit.geocall.basic.ui.xlsx.StandardFunction
This class implements a series of functions that allow to manage cells and formulas of a sheet.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringdecodeFunction(String function, int startRow, int startCol, int size) static StringdecodeFunction(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.CellgetEndFormula(org.apache.poi.ss.usermodel.Sheet sheet, String function, int startRow, int startCol, int endRow, int endCol) Gets aCellcontaining a formula or and empty cell, if the function is null.
If into the function there is a '#currow', willl be replace with endRow+1static org.apache.poi.ss.usermodel.CellgetFormula(org.apache.poi.ss.usermodel.Sheet sheet, String function, int startRow, int startCol, int size) static org.apache.poi.ss.usermodel.CellgetFormula(org.apache.poi.ss.usermodel.Sheet sheet, String function, int startRow, int startCol, int endRow, int endCol) Gets aCellcontaining a function or and empty cell, if the function is null.static void
-
Field Details
-
SOMMA
public static final char SOMMACreates a new instance of StandardFunction- See Also:
-
MEDIA
public static final char MEDIA- See Also:
-
MAX
public static final char MAX- See Also:
-
MIN
public static final char MIN- See Also:
-
STARTCOL
- See Also:
-
STARTROW
- See Also:
-
ENDCOL
- See Also:
-
ENDROW
- See Also:
-
-
Constructor Details
-
StandardFunction
public StandardFunction()
-
-
Method Details
-
decodeFunction
-
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 aCellcontaining a function or and empty cell, if the function is null.- Parameters:
sheet- The sheetfunction- The function to insert in the cellstartRow- The start row of the areastartCol- The start column of the areaendRow- The end row of the areaendCol- The end column of the area- Returns:
- A
Cellcontaining 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 aCellcontaining 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 sheetfunction- The function to insert in the cellstartRow- The start row of the areastartCol- The start column of the areaendRow- The end row of the areaendCol- The end column of the arear- Returns:
- A
Cellcontaining 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 decodestartRow- The start row of the area to which the function refersstartCol- The start column of the area to which the function refersendRow- The end row of the area to which the function refersendCol- The end column of the area to which the function refers- Returns:
- The function decoded.
-
main
-