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.

FormulaParsingWorkbook.java 2.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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.SpreadsheetVersion;
  17. import org.apache.poi.ss.formula.ptg.Ptg;
  18. import org.apache.poi.ss.usermodel.Name;
  19. import org.apache.poi.ss.usermodel.Table;
  20. import org.apache.poi.ss.util.AreaReference;
  21. import org.apache.poi.ss.util.CellReference;
  22. /**
  23. * Abstracts a workbook for the purpose of formula parsing.<br>
  24. *
  25. * For POI internal use only
  26. *
  27. * @author Josh Micich
  28. */
  29. public interface FormulaParsingWorkbook {
  30. /**
  31. * named range name matching is case insensitive
  32. */
  33. EvaluationName getName(String name, int sheetIndex);
  34. /**
  35. * Return the underlying workbook
  36. */
  37. Name createName();
  38. /**
  39. * XSSF Only - gets a table that exists in the worksheet
  40. */
  41. Table getTable(String name);
  42. /**
  43. * Return an external name (named range, function, user-defined function) Ptg
  44. */
  45. Ptg getNameXPtg(String name, SheetIdentifier sheet);
  46. /**
  47. * Produce the appropriate Ptg for a 3d cell reference
  48. */
  49. Ptg get3DReferencePtg(CellReference cell, SheetIdentifier sheet);
  50. /**
  51. * Produce the appropriate Ptg for a 3d area reference
  52. */
  53. Ptg get3DReferencePtg(AreaReference area, SheetIdentifier sheet);
  54. /**
  55. * gets the externSheet index for a sheet from this workbook
  56. */
  57. int getExternalSheetIndex(String sheetName);
  58. /**
  59. * gets the externSheet index for a sheet from an external workbook
  60. * @param workbookName e.g. "Budget.xls"
  61. * @param sheetName a name of a sheet in that workbook
  62. */
  63. int getExternalSheetIndex(String workbookName, String sheetName);
  64. /**
  65. * Returns an enum holding spreadhseet properties specific to an Excel version (
  66. * max column and row numbers, max arguments to a function, etc.)
  67. */
  68. SpreadsheetVersion getSpreadsheetVersion();
  69. }