public class CalculationData
extends java.lang.Object
Remarks
All objects provided by this class are for "read" purpose only. User should not change any data in the Workbook during the formula calculation process, Otherwise unexpected result or Exception may be caused.| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
getCalculatedValue()
Gets the calculated value for this function.
|
Cell |
getCell()
Gets the Cell object where the function is in.
|
int |
getCellColumn()
Gets the column index of the cell where the function is in.
|
int |
getCellRow()
Gets the row index of the cell where the function is in.
|
java.lang.String |
getFunctionName()
Gets the function name to be calculated.
|
int |
getParamCount()
Gets the count of parameters
|
java.lang.String |
getParamText(int index)
Gets the literal text of the parameter at given index.
|
java.lang.Object |
getParamValue(int index)
Gets the represented value object of the parameter at given index.
|
java.lang.Object[][] |
getParamValueInArrayMode(int index,
int maxRowCount,
int maxColumnCount)
Gets the value(s) of the parameter at given index.
|
Workbook |
getWorkbook()
Gets the Workbook object where the function is in.
|
Worksheet |
getWorksheet()
Gets the Worksheet object where the function is in.
|
void |
setCalculatedValue(java.lang.Object value)
Sets the calculated value for this function.
|
public java.lang.Object getCalculatedValue()
Remarks
User should set this property in his custom calculation engine for those functions the engine supports, and the set value will be returned when getting this property later. The set value may be of possible types ofCell.getValue(),
or array of such kind of values, or a Range, Name, ReferredArea.
Getting this property before setting value to it will make the function be calculated
by the default calculation engine of Aspose.Cells and then the calculated value will
be returned(generally it should be #NAME? for user-defined functions).public void setCalculatedValue(java.lang.Object value)
Remarks
User should set this property in his custom calculation engine for those functions the engine supports, and the set value will be returned when getting this property later. The set value may be of possible types ofCell.getValue(),
or array of such kind of values, or a Range, Name, ReferredArea.
Getting this property before setting value to it will make the function be calculated
by the default calculation engine of Aspose.Cells and then the calculated value will
be returned(generally it should be #NAME? for user-defined functions).public Workbook getWorkbook()
public Worksheet getWorksheet()
public int getCellRow()
public int getCellColumn()
public Cell getCell()
Remarks
When calculating a formula without setting it to a cell, such as byWorksheet.calculateFormula(String,CalculationOptions),
the formula will be calculated just like it has been set to cell A1,
so both getCellRow() and getCellColumn() are 0.
However, cell A1 in the worksheet may has not been instantiated.
So for such kind of situation this property will be null.public java.lang.String getFunctionName()
public int getParamCount()
public java.lang.Object getParamValue(int index)
Remarks
For one parameter:If it is plain value, then returns the plain value itself;
If it is reference, then returns ReferredArea object;
If it references to dataset(s) with multiple values, then returns array of objects;
If it is some kind of expression that needs to be calculated, then it will be calculated in value mode
and generally a single value will be returned according to current cell base. For example,
if one parameter of D2's formula is A:A+B:B, then A2+B2 will be calculated and returned.
However, if this parameter has been specified as array mode
(by
index - The index of the parameter(0 based)public java.lang.Object[][] getParamValueInArrayMode(int index,
int maxRowCount,
int maxColumnCount)
Remarks
For an expression that needs to be calculated, taking A:A+B:B as an example: In value mode it will be calculated to a single value according to current cell base. But in array mode, all values of A1+B1,A2+B2,A3+B3,... will be calculated and used to construct the returned array. And for such kind of situation, it is better to specify the limit for the row/column count (such as according toCells.getMaxDataRow() and Cells.getMaxDataColumn()),
otherwise the returned large array may increase memory cost with large amount of useless data.index - The index of the parameter(0 based)maxRowCount - The row count limit for the returned array.
If it is non-positive or greater than the actual row count, then actual row count will be used.maxColumnCount - The column count limit for the returned array.
If it is non-positive or greater than the actual row count, then actual column count will be used.public java.lang.String getParamText(int index)
index - index of the parameter(0 based)See Also:
Aspose.Cells Documentation - the home page for the Aspose.Cells Product Documentation.
Aspose.Cells Support Forum - our preferred method of support.
We guarantee a prompt response to any inquiry!
© Aspose Pty Ltd 2003-2025. All Rights Reserved.