/** * Calculates function value * * @return Function value as double. */ public double calculate() { if (functionBodyType == BODY_RUNTIME) { return(functionExpression.calculate()); } else { return(functionExtension.calculate()); } }
/** * Gets argument value. * * @return direct argument value for free argument, * otherwise returns calculated argument value * based on the argument expression. */ public double getArgumentValue() { if (argumentBodyType == BODY_EXTENDED) { var temp = argumentExtension.getArgumentValue(); //Expression.ArgumentsResult.TryAdd(this.argumentName, temp); return(temp); } if (argumentType == FREE_ARGUMENT) { if (functionSpecified) { if (functionToCalculate != null) { _argumentValue = functionToCalculate.calculate(); } else if (functionExtensionToCalculate != null) { _argumentValue = functionExtensionToCalculate.calculate(); } //Expression.ArgumentsResult.TryAdd(this.argumentName, _argumentValue); argumentValue = _argumentValue; return(_argumentValue); } else { //Expression.ArgumentsResult.TryAdd(this.argumentName, argumentValue); return(argumentValue); } } else { var temp = argumentExpression.calculate(); //Expression.ArgumentsResult.TryAdd(this.argumentName, temp); return(temp); } }