예제 #1
0
        public WorkbookEvaluator(IEvaluationWorkbook workbook, IEvaluationListener evaluationListener, IStabilityClassifier stabilityClassifier, UDFFinder udfFinder)
        {
            _workbook = workbook;
            _evaluationListener = evaluationListener;
            _cache = new EvaluationCache(evaluationListener);
            _sheetIndexesBySheet = new Hashtable();
            _sheetIndexesByName = new Dictionary<string, int>();
            _collaboratingWorkbookEnvironment = CollaboratingWorkbooksEnvironment.EMPTY;
            _workbookIx = 0;
            _stabilityClassifier = stabilityClassifier;

            AggregatingUDFFinder defaultToolkit = // workbook can be null in unit tests
                workbook == null ? null : (AggregatingUDFFinder)workbook.GetUDFFinder();
            if (defaultToolkit != null && udfFinder != null)
            {
                defaultToolkit.Add(udfFinder);
            }
            _udfFinder = defaultToolkit;
        }
예제 #2
0
 /**
  * Register a new toolpack in this workbook.
  *
  * @param toopack the toolpack to register
  */
 public void AddToolPack(UDFFinder toopack)
 {
     _udfFinder.Add(toopack);
 }
예제 #3
0
        /**
     *
     * @param name the  name of an external function, typically a name of a UDF
     * @param udf  locator of user-defiend functions to resolve names of VBA and Add-In functions
     * @return the external name or null
     */
        public NameXPtg GetNameXPtg(String name, UDFFinder udf)
        {
            LinkTable lnk = OrCreateLinkTable;
            NameXPtg xptg = lnk.GetNameXPtg(name);

            if (xptg == null && udf.FindFunction(name) != null)
            {
                // the name was not found in the list of external names
                // check if the Workbook's UDFFinder is aware about it and register the name if it is
                xptg = lnk.AddNameXPtg(name);
            }
            return xptg;
        }
예제 #4
0
 /**
  * @param stabilityClassifier used to optimise caching performance. Pass <code>null</code>
  * for the (conservative) assumption that any cell may have its defInition Changed After
  * Evaluation begins.
  * @param udfFinder pass <code>null</code> for default (AnalysisToolPak only)
  */
 public static XSSFFormulaEvaluator Create(XSSFWorkbook workbook, IStabilityClassifier stabilityClassifier, UDFFinder udfFinder)
 {
     return new XSSFFormulaEvaluator(workbook, stabilityClassifier, udfFinder);
 }
예제 #5
0
 private XSSFFormulaEvaluator(XSSFWorkbook workbook, IStabilityClassifier stabilityClassifier, UDFFinder udfFinder)
 {
     _bookEvaluator = new WorkbookEvaluator(XSSFEvaluationWorkbook.Create(workbook), stabilityClassifier, udfFinder);
     _book = workbook;
 }
예제 #6
0
 /// <summary>
 /// Add a new toolpack
 /// </summary>
 /// <param name="toolPack"></param>
 public void Add(UDFFinder toolPack)
 {
     _usedToolPacks.Add(toolPack);
 }
예제 #7
0
 /**
  * @param udfFinder pass <code>null</code> for default (AnalysisToolPak only)
  */
 public HSSFFormulaEvaluator(IWorkbook workbook, IStabilityClassifier stabilityClassifier, UDFFinder udfFinder)
 {
     _bookEvaluator = new WorkbookEvaluator(HSSFEvaluationWorkbook.Create(workbook), stabilityClassifier, udfFinder);
 }
예제 #8
0
 public NameXPtg GetNameXPtg(String name, UDFFinder udf)
 {
     return GetNameXPtg(name, -1, udf);
 }
예제 #9
0
 /// <summary>
 /// Add a new toolpack
 /// </summary>
 /// <param name="toolPack"></param>
 public void Add(UDFFinder toolPack)
 {
     _usedToolPacks.Add(toolPack);
 }
예제 #10
0
        public WorkbookEvaluator(IEvaluationWorkbook workbook, IStabilityClassifier stabilityClassifier, UDFFinder udfFinder)
            : this(workbook, null, stabilityClassifier, udfFinder)
        {

        }
예제 #11
0
        /**
 * Register a new toolpack in this workbook.
 *
 * @param toopack the toolpack to register
 */
        public void AddToolPack(UDFFinder toopack)
        {
            AggregatingUDFFinder udfs = (AggregatingUDFFinder)_udfFinder;
            udfs.Add(toopack);
        }
예제 #12
0
 /**
  * @param udfFinder pass <code>null</code> for default (AnalysisToolPak only)
  */
 public static ForkedEvaluator Create(IWorkbook wb, IStabilityClassifier stabilityClassifier, UDFFinder udfFinder)
 {
     return new ForkedEvaluator(CreateEvaluationWorkbook(wb), stabilityClassifier, udfFinder);
 }
예제 #13
0
 private ForkedEvaluator(IEvaluationWorkbook masterWorkbook, IStabilityClassifier stabilityClassifier, UDFFinder udfFinder)
 {
     _sewb = new ForkedEvaluationWorkbook(masterWorkbook);
     _evaluator = new WorkbookEvaluator(_sewb, stabilityClassifier, udfFinder);
 }