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.

AreaEval.java 3.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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.ThreeDEval;
  17. import org.apache.poi.ss.formula.TwoDEval;
  18. /**
  19. * Evaluation of 2D (Row+Column) and 3D (Sheet+Row+Column) areas
  20. */
  21. public interface AreaEval extends TwoDEval, ThreeDEval {
  22. /**
  23. * returns the 0-based index of the first row in
  24. * this area.
  25. */
  26. int getFirstRow();
  27. /**
  28. * returns the 0-based index of the last row in
  29. * this area.
  30. */
  31. int getLastRow();
  32. /**
  33. * returns the 0-based index of the first col in
  34. * this area.
  35. */
  36. int getFirstColumn();
  37. /**
  38. * returns the 0-based index of the last col in
  39. * this area.
  40. */
  41. int getLastColumn();
  42. /**
  43. * @return the ValueEval from within this area at the specified row and col index. Never
  44. * <code>null</code> (possibly {@link BlankEval}). The specified indexes should be absolute
  45. * indexes in the sheet and not relative indexes within the area.
  46. */
  47. ValueEval getAbsoluteValue(int row, int col);
  48. /**
  49. * returns true if the cell at row and col specified
  50. * as absolute indexes in the sheet is contained in
  51. * this area.
  52. * @param row
  53. * @param col
  54. */
  55. boolean contains(int row, int col);
  56. /**
  57. * returns true if the specified col is in range
  58. * @param col
  59. */
  60. boolean containsColumn(int col);
  61. /**
  62. * returns true if the specified row is in range
  63. * @param row
  64. */
  65. boolean containsRow(int row);
  66. int getWidth();
  67. int getHeight();
  68. /**
  69. * @return the ValueEval from within this area at the specified relativeRowIndex and
  70. * relativeColumnIndex. Never <code>null</code> (possibly {@link BlankEval}). The
  71. * specified indexes should relative to the top left corner of this area.
  72. */
  73. ValueEval getRelativeValue(int relativeRowIndex, int relativeColumnIndex);
  74. /**
  75. * Creates an {@link AreaEval} offset by a relative amount from from the upper left cell
  76. * of this area
  77. */
  78. AreaEval offset(int relFirstRowIx, int relLastRowIx, int relFirstColIx, int relLastColIx);
  79. }