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.

RefEval.java 2.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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.eval;
  16. import org.apache.poi.ss.formula.SheetRange;
  17. import org.apache.poi.ss.usermodel.CellType;
  18. /**
  19. * RefEval is the super interface for Ref2D and Ref3DEval. Basically a RefEval
  20. * impl should contain reference to the original ReferencePtg or Ref3DPtg as
  21. * well as the final "value" resulting from the evaluation of the cell
  22. * reference. Thus if the Cell has type {@link CellType#NUMERIC}, the contained
  23. * value object should be of type NumberEval; if cell type is {@link CellType#STRING},
  24. * contained value object should be of type StringEval
  25. */
  26. public interface RefEval extends ValueEval, SheetRange {
  27. /**
  28. * @return the evaluated value of the cell referred to by this RefEval on the given sheet
  29. */
  30. ValueEval getInnerValueEval(int sheetIndex);
  31. /**
  32. * returns the zero based column index.
  33. */
  34. int getColumn();
  35. /**
  36. * returns the zero based row index.
  37. */
  38. int getRow();
  39. /**
  40. * returns the first sheet index this applies to
  41. */
  42. int getFirstSheetIndex();
  43. /**
  44. * returns the last sheet index this applies to, which
  45. * will be the same as the first for a 2D and many 3D references
  46. */
  47. int getLastSheetIndex();
  48. /**
  49. * returns the number of sheets this applies to
  50. */
  51. int getNumberOfSheets();
  52. /**
  53. * Creates an {@link AreaEval} offset by a relative amount from this RefEval
  54. */
  55. AreaEval offset(int relFirstRowIx, int relLastRowIx, int relFirstColIx, int relLastColIx);
  56. }