ILIAS
Release_4_0_x_branch Revision 61816
|
Public Member Functions | |
__clone () | |
__clone implementation. | |
getCalculationCacheEnabled () | |
Is calculation caching enabled? | |
setCalculationCacheEnabled ($pValue=true) | |
Enable/disable calculation cache. | |
enableCalculationCache () | |
Enable calculation cache. | |
disableCalculationCache () | |
Disable calculation cache. | |
clearCalculationCache () | |
Clear calculation cache. | |
getCalculationCacheExpirationTime () | |
Get calculation cache expiration time. | |
setCalculationCacheExpirationTime ($pValue=0.01) | |
Set calculation cache expiration time. | |
calculate (PHPExcel_Cell $pCell=null) | |
Calculate cell value (using formula from a cell ID) Retained for backward compatibility. | |
calculateCellValue (PHPExcel_Cell $pCell=null, $resetLog=true) | |
Calculate the value of a cell formula. | |
parseFormula ($formula) | |
Validate and parse a formula string. | |
calculateFormula ($formula, $cellID=null, PHPExcel_Cell $pCell=null) | |
Calculate the value of a formula. | |
_calculateFormulaValue ($formula, $cellID=null, PHPExcel_Cell $pCell=null) | |
Parse a cell formula and calculate its value. | |
extractCellRange ($pRange= 'A1', PHPExcel_Worksheet $pSheet=null, $resetLog=true) | |
Extract range values. | |
extractNamedRange ($pRange= 'A1', PHPExcel_Worksheet $pSheet=null, $resetLog=true) | |
Extract range values. | |
isImplemented ($pFunction= '') | |
Is a specific function implemented? | |
listFunctions () | |
Get a list of all implemented functions as an array of function objects. | |
listFunctionNames () | |
Get a list of implemented Excel function names. |
Static Public Member Functions | |
static | getInstance () |
Get an instance of this class. | |
static | setArrayReturnType ($returnType) |
Set the Array Return Type (Array or Value of first element in the array) | |
static | getArrayReturnType () |
Return the Array Return Type (Array or Value of first element in the array) | |
static | _wrapResult ($value) |
Wrap string values in quotes. | |
static | _unwrapResult ($value) |
Remove quotes used as a wrapper to identify string values. |
Data Fields | |
const | CALCULATION_REGEXP_NUMBER = '[-+]?\d*\.?\d+(e[-+]?\d+)?' |
Constants. | |
const | CALCULATION_REGEXP_STRING = '"(?:[^"]|"")*"' |
const | CALCULATION_REGEXP_OPENBRACE = '\(' |
const | CALCULATION_REGEXP_FUNCTION = '([A-Z][A-Z0-9\.]*)[\s]*\(' |
const | CALCULATION_REGEXP_CELLREF = '(((\w*)|(\'.*\')|(\".*\"))!)?\$?([a-z]+)\$?(\d+)(:\$?([a-z]+)\$?(\d+))?' |
const | CALCULATION_REGEXP_NAMEDRANGE = '(((\w*)|(\'.*\')|(\".*\"))!)?([_A-Z][_A-Z0-9]*)' |
const | CALCULATION_REGEXP_ERROR = '\#[^!]+!' |
const | RETURN_ARRAY_AS_VALUE = 'value' |
constants | |
const | RETURN_ARRAY_AS_ARRAY = 'array' |
$suppressFormulaErrors = false | |
$formulaError = null | |
$writeDebugLog = false | |
$debugLog = array() |
Private Member Functions | |
_parseFormula ($formula) | |
_processTokenStack ($tokens, $cellID=null, PHPExcel_Cell $pCell=null) | |
_validateBinaryOperand ($cellID, &$operand, &$stack) | |
_executeBinaryComparisonOperation ($cellID, $operand1, $operand2, $operation, &$stack) | |
_executeNumericBinaryOperation ($cellID, $operand1, $operand2, $operation, $matrixFunction, &$stack) | |
_writeDebug ($cellID, $message) | |
_raiseFormulaError ($errorMessage) |
Static Private Member Functions | |
static | _checkMatrixOperands (&$operand1, &$operand2, $resize=1) |
Ensure that paired matrix operands are both matrices and of the same size. | |
static | _reindexMatrixDimensions ($matrix) |
Re-index a matrix with straight numeric keys starting from row 0, column 0. | |
static | _getMatrixDimensions (&$matrix) |
Read the dimensions of a matrix, and re-index it with straight numeric keys starting from row 0, column 0. | |
static | _resizeMatricesShrink (&$matrix1, &$matrix2) |
Ensure that paired matrix operands are both matrices of the same size. | |
static | _resizeMatricesExtend (&$matrix1, &$matrix2) |
Ensure that paired matrix operands are both matrices of the same size. | |
static | _showValue ($value) |
Format details of an operand for display in the log (based on operand type) | |
static | _showTypeDetails ($value) |
Format type and details of an operand for display in the log (based on operand type) | |
static | _convertMatrixReferences ($formula) |
static | _mkMatrix () |
Private Attributes | |
$_calculationCache = array () | |
$_calculationCacheEnabled = true | |
$_calculationCacheExpirationTime = 0.01 | |
$_operators = array('+', '-', '*', '/', '^', '&', '%', '_', '>', '<', '=', '>=', '<=', '<>') | |
$_binaryOperators = array('+', '-', '*', '/', '^', '&', '>', '<', '=', '>=', '<=', '<>') | |
$debugLogStack = array() | |
$_ExcelConstants | |
$_PHPExcelFunctions | |
$_controlFunctions |
Static Private Attributes | |
static | $returnArrayAsType = self::RETURN_ARRAY_AS_ARRAY |
static | $_instance |
Definition at line 54 of file Calculation.php.
|
final |
__clone implementation.
Cloning should not be allowed in a Singleton!
public
Exception |
Definition at line 1594 of file Calculation.php.
PHPExcel_Calculation::_calculateFormulaValue | ( | $formula, | |
$cellID = null , |
|||
PHPExcel_Cell | $pCell = null |
||
) |
Parse a cell formula and calculate its value.
string | $formula | The formula to parse and calculate |
string | $cellID | The ID (e.g. A3) of the cell that we are calculating |
PHPExcel_Cell | $pCell | Cell to calculate |
Exception |
Definition at line 1840 of file Calculation.php.
References $_calculationCacheExpirationTime, _parseFormula(), _processTokenStack(), _wrapResult(), _writeDebug(), and PHPExcel_Calculation_Functions\flattenArray().
Referenced by calculateCellValue(), and calculateFormula().
|
staticprivate |
Ensure that paired matrix operands are both matrices and of the same size.
mixed | $operand1 | First matrix operand |
mixed | $operand2 | Second matrix operand |
Definition at line 1909 of file Calculation.php.
References _getMatrixDimensions(), _resizeMatricesExtend(), _resizeMatricesShrink(), and elseif().
Referenced by _executeNumericBinaryOperation(), and _processTokenStack().
|
staticprivate |
Definition at line 2125 of file Calculation.php.
References _raiseFormulaError(), and elseif().
|
private |
Definition at line 2747 of file Calculation.php.
References $result, and _writeDebug().
Referenced by _processTokenStack().
|
private |
Definition at line 2785 of file Calculation.php.
References $result, _checkMatrixOperands(), _validateBinaryOperand(), and _writeDebug().
Referenced by _processTokenStack().
|
staticprivate |
Read the dimensions of a matrix, and re-index it with straight numeric keys starting from row 0, column 0.
mixed | $matrix | matrix operand |
Definition at line 1951 of file Calculation.php.
Referenced by _checkMatrixOperands(), _resizeMatricesExtend(), and _resizeMatricesShrink().
|
staticprivate |
Definition at line 2176 of file Calculation.php.
|
private |
Definition at line 2182 of file Calculation.php.
References _raiseFormulaError(), and elseif().
Referenced by _calculateFormulaValue(), and parseFormula().
|
private |
Definition at line 2469 of file Calculation.php.
References $result, _checkMatrixOperands(), _executeBinaryComparisonOperation(), _executeNumericBinaryOperation(), _raiseFormulaError(), _showValue(), _unwrapResult(), _writeDebug(), elseif(), extractCellRange(), extractNamedRange(), and PHPExcel_Calculation_Functions\REF().
Referenced by _calculateFormulaValue().
|
private |
Definition at line 2858 of file Calculation.php.
Referenced by _convertMatrixReferences(), _parseFormula(), and _processTokenStack().
|
staticprivate |
Re-index a matrix with straight numeric keys starting from row 0, column 0.
mixed | $matrix | matrix operand |
Definition at line 1937 of file Calculation.php.
|
staticprivate |
Ensure that paired matrix operands are both matrices of the same size.
mixed | $matrix1 | First matrix operand |
mixed | $matrix2 | Second matrix operand |
Definition at line 2014 of file Calculation.php.
References $x, and _getMatrixDimensions().
Referenced by _checkMatrixOperands().
|
staticprivate |
Ensure that paired matrix operands are both matrices of the same size.
mixed | $matrix1 | First matrix operand |
mixed | $matrix2 | Second matrix operand |
Definition at line 1972 of file Calculation.php.
References _getMatrixDimensions().
Referenced by _checkMatrixOperands().
|
staticprivate |
Format type and details of an operand for display in the log (based on operand type)
mixed | $value | First matrix operand |
Definition at line 2094 of file Calculation.php.
References _showValue(), and elseif().
|
staticprivate |
Format details of an operand for display in the log (based on operand type)
mixed | $value | First matrix operand |
Definition at line 2060 of file Calculation.php.
References $row, and elseif().
Referenced by _processTokenStack(), and _showTypeDetails().
|
static |
Remove quotes used as a wrapper to identify string values.
mixed | $value |
Definition at line 1726 of file Calculation.php.
References PHPExcel_Calculation_Functions\NaN().
Referenced by _processTokenStack(), _validateBinaryOperand(), calculateCellValue(), and calculateFormula().
|
private |
Definition at line 2720 of file Calculation.php.
References _unwrapResult(), and _writeDebug().
Referenced by _executeNumericBinaryOperation().
|
static |
Wrap string values in quotes.
mixed | $value |
Definition at line 1702 of file Calculation.php.
References PHPExcel_Calculation_Functions\NaN().
Referenced by _calculateFormulaValue(), PHPExcel_Calculation_Functions\COUNTIF(), and PHPExcel_Calculation_Functions\SUMIF().
|
private |
Definition at line 2847 of file Calculation.php.
Referenced by _calculateFormulaValue(), _executeBinaryComparisonOperation(), _executeNumericBinaryOperation(), _processTokenStack(), and _validateBinaryOperand().
PHPExcel_Calculation::calculate | ( | PHPExcel_Cell | $pCell = null | ) |
Calculate cell value (using formula from a cell ID) Retained for backward compatibility.
public
PHPExcel_Cell | $pCell | Cell to calculate |
Exception |
Definition at line 1750 of file Calculation.php.
References calculateCellValue().
PHPExcel_Calculation::calculateCellValue | ( | PHPExcel_Cell | $pCell = null , |
$resetLog = true |
|||
) |
Calculate the value of a cell formula.
public
PHPExcel_Cell | $pCell | Cell to calculate |
Boolean | $resetLog | Flag indicating whether the debug log should be reset or not |
Exception |
Definition at line 1764 of file Calculation.php.
References _calculateFormulaValue(), and _unwrapResult().
Referenced by calculate().
PHPExcel_Calculation::calculateFormula | ( | $formula, | |
$cellID = null , |
|||
PHPExcel_Cell | $pCell = null |
||
) |
Calculate the value of a formula.
string | $formula | Formula to parse |
Exception |
Definition at line 1812 of file Calculation.php.
References $result, _calculateFormulaValue(), _unwrapResult(), and getCalculationCacheEnabled().
PHPExcel_Calculation::clearCalculationCache | ( | ) |
Clear calculation cache.
Definition at line 1669 of file Calculation.php.
Referenced by setCalculationCacheEnabled().
PHPExcel_Calculation::disableCalculationCache | ( | ) |
Disable calculation cache.
Definition at line 1661 of file Calculation.php.
References setCalculationCacheEnabled().
PHPExcel_Calculation::enableCalculationCache | ( | ) |
Enable calculation cache.
Definition at line 1653 of file Calculation.php.
References setCalculationCacheEnabled().
PHPExcel_Calculation::extractCellRange | ( | $pRange = 'A1' , |
|
PHPExcel_Worksheet | $pSheet = null , |
||
$resetLog = true |
|||
) |
Extract range values.
string | $pRange | String based range representation |
PHPExcel_Worksheet | $pSheet | Worksheet |
Exception |
Definition at line 2873 of file Calculation.php.
References PHPExcel_Cell\coordinateFromString(), PHPExcel_Cell\extractAllCellReferencesInRange(), and PHPExcel_Worksheet\extractSheetTitle().
Referenced by _processTokenStack().
PHPExcel_Calculation::extractNamedRange | ( | $pRange = 'A1' , |
|
PHPExcel_Worksheet | $pSheet = null , |
||
$resetLog = true |
|||
) |
Extract range values.
string | $pRange | String based range representation |
PHPExcel_Worksheet | $pSheet | Worksheet |
Exception |
Definition at line 2920 of file Calculation.php.
References PHPExcel_Cell\coordinateFromString(), PHPExcel_Cell\extractAllCellReferencesInRange(), PHPExcel_Worksheet\extractSheetTitle(), and PHPExcel_NamedRange\resolveRange().
Referenced by _processTokenStack().
|
static |
Return the Array Return Type (Array or Value of first element in the array)
public
Definition at line 1622 of file Calculation.php.
References $returnArrayAsType.
Referenced by PHPExcel_Writer_PDF\save(), PHPExcel_Writer_CSV\save(), and PHPExcel_Writer_HTML\save().
PHPExcel_Calculation::getCalculationCacheEnabled | ( | ) |
Is calculation caching enabled?
public
Definition at line 1633 of file Calculation.php.
References $_calculationCacheEnabled.
Referenced by calculateFormula().
PHPExcel_Calculation::getCalculationCacheExpirationTime | ( | ) |
Get calculation cache expiration time.
Definition at line 1679 of file Calculation.php.
References $_calculationCacheExpirationTime.
|
static |
Get an instance of this class.
public
Definition at line 1579 of file Calculation.php.
References $_instance.
Referenced by PHPExcel_Calculation_Functions\COUNTIF(), PHPExcel_Cell\getCalculatedValue(), and PHPExcel_Calculation_Functions\SUMIF().
PHPExcel_Calculation::isImplemented | ( | $pFunction = '' | ) |
Is a specific function implemented?
string | $pFunction | Function Name |
Definition at line 2989 of file Calculation.php.
PHPExcel_Calculation::listFunctionNames | ( | ) |
Get a list of implemented Excel function names.
Definition at line 3027 of file Calculation.php.
PHPExcel_Calculation::listFunctions | ( | ) |
Get a list of all implemented functions as an array of function objects.
Definition at line 3004 of file Calculation.php.
PHPExcel_Calculation::parseFormula | ( | $formula | ) |
Validate and parse a formula string.
string | $formula | Formula to parse |
Exception |
Definition at line 1791 of file Calculation.php.
References _parseFormula().
|
static |
Set the Array Return Type (Array or Value of first element in the array)
public
string | $returnType | Array return type |
Definition at line 1606 of file Calculation.php.
Referenced by PHPExcel_Writer_PDF\save(), PHPExcel_Writer_CSV\save(), and PHPExcel_Writer_HTML\save().
PHPExcel_Calculation::setCalculationCacheEnabled | ( | $pValue = true | ) |
Enable/disable calculation cache.
public
boolean | $pValue |
Definition at line 1644 of file Calculation.php.
References clearCalculationCache().
Referenced by disableCalculationCache(), and enableCalculationCache().
PHPExcel_Calculation::setCalculationCacheExpirationTime | ( | $pValue = 0.01 | ) |
Set calculation cache expiration time.
float | $pValue |
Definition at line 1689 of file Calculation.php.
|
private |
Definition at line 131 of file Calculation.php.
|
private |
Definition at line 95 of file Calculation.php.
|
private |
Definition at line 104 of file Calculation.php.
Referenced by getCalculationCacheEnabled().
|
private |
Definition at line 113 of file Calculation.php.
Referenced by _calculateFormulaValue(), and getCalculationCacheExpirationTime().
|
private |
Definition at line 1564 of file Calculation.php.
|
private |
Definition at line 141 of file Calculation.php.
|
staticprivate |
Definition at line 86 of file Calculation.php.
Referenced by getInstance().
|
private |
Definition at line 122 of file Calculation.php.
|
private |
Definition at line 147 of file Calculation.php.
PHPExcel_Calculation::$debugLog = array() |
Definition at line 137 of file Calculation.php.
|
private |
Definition at line 136 of file Calculation.php.
PHPExcel_Calculation::$formulaError = null |
Definition at line 134 of file Calculation.php.
|
staticprivate |
Definition at line 78 of file Calculation.php.
Referenced by getArrayReturnType().
PHPExcel_Calculation::$suppressFormulaErrors = false |
Definition at line 133 of file Calculation.php.
PHPExcel_Calculation::$writeDebugLog = false |
Definition at line 135 of file Calculation.php.
const PHPExcel_Calculation::CALCULATION_REGEXP_CELLREF = '(((\w*)|(\'.*\')|(\".*\"))!)?\$?([a-z]+)\$?(\d+)(:\$?([a-z]+)\$?(\d+))?' |
Definition at line 67 of file Calculation.php.
Referenced by PHPExcel_Worksheet\cellExists(), PHPExcel_Worksheet\getCell(), and PHPExcel_ReferenceHelper\updateFormulaReferences().
const PHPExcel_Calculation::CALCULATION_REGEXP_ERROR = '\#[^!]+!' |
Definition at line 71 of file Calculation.php.
const PHPExcel_Calculation::CALCULATION_REGEXP_FUNCTION = '([A-Z][A-Z0-9\.]*)[\s]*\(' |
Definition at line 65 of file Calculation.php.
const PHPExcel_Calculation::CALCULATION_REGEXP_NAMEDRANGE = '(((\w*)|(\'.*\')|(\".*\"))!)?([_A-Z][_A-Z0-9]*)' |
Definition at line 69 of file Calculation.php.
const PHPExcel_Calculation::CALCULATION_REGEXP_NUMBER = '[-+]?\d*\.?\d+(e[-+]?\d+)?' |
const PHPExcel_Calculation::CALCULATION_REGEXP_OPENBRACE = '\(' |
Definition at line 63 of file Calculation.php.
const PHPExcel_Calculation::CALCULATION_REGEXP_STRING = '"(?:[^"]|"")*"' |
Definition at line 61 of file Calculation.php.
const PHPExcel_Calculation::RETURN_ARRAY_AS_ARRAY = 'array' |
Definition at line 76 of file Calculation.php.
const PHPExcel_Calculation::RETURN_ARRAY_AS_VALUE = 'value' |
constants
Definition at line 75 of file Calculation.php.
Referenced by PHPExcel_Writer_PDF\save(), PHPExcel_Writer_CSV\save(), and PHPExcel_Writer_HTML\save().