com.aspose.cells

Class AbstractCalculationEngine

  • java.lang.Object
    • com.aspose.cells.AbstractCalculationEngine
public abstract class AbstractCalculationEngine 
extends java.lang.Object

Represents user's custom calculation engine to extend the default calculation engine of Aspose.Cells.
User should not modify any part in the Workbook directly in this implementation(except the calculated result of the custom function, for which user can set by CalculationData.CalculatedValue property), Otherwise unexpected result or Exception may be caused. If user needs to change other data than calculated result in the implementation for some custom functions, for example, change cell's formula, style, ...etc., user should gather those data in this implementation and change them out of the scope of formula calculation.

Property Getters/Setters Summary
booleanisParamLiteralRequired()
Indicates whether this engine needs the literal text of parameter while doing calculation. Default value is false.
 
Method Summary
abstract voidcalculate(CalculationData data)
Calculates one function with given data.
 

    • Property Getters/Setters Detail

      • isParamLiteralRequired

        public boolean isParamLiteralRequired()
        
        Indicates whether this engine needs the literal text of parameter while doing calculation. Default value is false. If this custom calculation engine requires the parameter's literal text, more stacks will be required to cache the literal text for parameters and Calculate() method may be called recursively to calcualte the parameter's value. Commonly the literal text is not needed for calculating formulas and this method should return false for most implementations to get better performance.
    • Method Detail

      • calculate

        public abstract void calculate(CalculationData data)
        Calculates one function with given data. User should set the calculated value for given data for all functions(including excel native functions) that he wants to calculate by himself in this implementation.
        Parameters:
        data - the required data to calculate function such as function name, parameters, ...etc.