You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

IEvaluationListener.java 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* ====================================================================
  2. Licensed to the Apache Software Foundation (ASF) under one or more
  3. contributor license agreements. See the NOTICE file distributed with
  4. this work for additional information regarding copyright ownership.
  5. The ASF licenses this file to You under the Apache License, Version 2.0
  6. (the "License"); you may not use this file except in compliance with
  7. the License. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. ==================================================================== */
  15. package org.apache.poi.ss.formula;
  16. import org.apache.poi.ss.formula.eval.ValueEval;
  17. /**
  18. * Tests can implement this class to track the internal working of the {@link WorkbookEvaluator}.<br>
  19. *
  20. * For POI internal testing use only
  21. *
  22. * @author Josh Micich
  23. */
  24. interface IEvaluationListener {
  25. /**
  26. * A (mostly) opaque interface to allow test clients to trace cache values
  27. * Each spreadsheet cell gets one unique cache entry instance. These objects
  28. * are safe to use as keys in {@link java.util.HashMap}s
  29. */
  30. interface ICacheEntry {
  31. ValueEval getValue();
  32. }
  33. void onCacheHit(int sheetIndex, int rowIndex, int columnIndex, ValueEval result);
  34. void onReadPlainValue(int sheetIndex, int rowIndex, int columnIndex, ICacheEntry entry);
  35. void onStartEvaluate(EvaluationCell cell, ICacheEntry entry);
  36. void onEndEvaluate(ICacheEntry entry, ValueEval result);
  37. void onClearWholeCache();
  38. void onClearCachedValue(ICacheEntry entry);
  39. /**
  40. * Internally, formula {@link ICacheEntry}s are stored in sets which may change ordering due
  41. * to seemingly trivial changes. This method is provided to make the order of call-backs to
  42. * {@link #onClearDependentCachedValue(ICacheEntry, int)} more deterministic.
  43. */
  44. void sortDependentCachedValues(ICacheEntry[] formulaCells);
  45. void onClearDependentCachedValue(ICacheEntry formulaCell, int depth);
  46. void onChangeFromBlankValue(int sheetIndex, int rowIndex, int columnIndex,
  47. EvaluationCell cell, ICacheEntry entry);
  48. }