net.sf.jxls.formula
Class CommonFormulaResolver

java.lang.Object
  extended by net.sf.jxls.formula.BaseFormulaResolver
      extended by net.sf.jxls.formula.CommonFormulaResolver
All Implemented Interfaces:
FormulaResolver

public class CommonFormulaResolver
extends BaseFormulaResolver

Implementation of FormulaResolver interface resolving formulas containing list range and label cell references like $[SUM(@employees.payment@)] and also formulas with direct cell references like $[SUM(E5)]

Author:
Leonid Vysochyn

Field Summary
 
Fields inherited from class net.sf.jxls.formula.BaseFormulaResolver
cellRangeSeparator, log, regexCellCharPart, regexCellDigitPart, regexCellRef, regexCellRefPattern
 
Constructor Summary
CommonFormulaResolver()
           
 
Method Summary
static java.lang.String replaceFormulaPart(java.lang.String formulaPart, java.lang.String refCell, java.lang.String newCell)
           
 java.lang.String resolve(Formula sourceFormula, WorkbookCellFinder cellFinder)
          This implementation first checks are there any list ranges in the source formula.
 
Methods inherited from class net.sf.jxls.formula.BaseFormulaResolver
getFormulaListRangeToken, setFormulaListRangeToken
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommonFormulaResolver

public CommonFormulaResolver()
Method Detail

resolve

public java.lang.String resolve(Formula sourceFormula,
                                WorkbookCellFinder cellFinder)
This implementation first checks are there any list ranges in the source formula. If source formula contains any list ranges then resolve original formula by replacing all list range names with corresponding cells. If there is no list ranges in the source formula then replace all transformed cells with their transformation results also trying to detect and put corresponding cell ranges (like a10:a20 or a10:h10 for example)

Parameters:
sourceFormula -
cellFinder -
Returns:
Adjusted formula string

replaceFormulaPart

public static java.lang.String replaceFormulaPart(java.lang.String formulaPart,
                                                  java.lang.String refCell,
                                                  java.lang.String newCell)


Copyright © 2005-2013 jXLS Team. All Rights Reserved.