Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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.ptg;
  16. import org.apache.poi.ss.util.CellReference;
  17. import org.apache.poi.util.LittleEndianInput;
  18. import org.apache.poi.util.LittleEndianOutput;
  19. abstract class Ref2DPtgBase extends RefPtgBase {
  20. private static final int SIZE = 5;
  21. protected Ref2DPtgBase(int row, int column, boolean isRowRelative, boolean isColumnRelative) {
  22. setRow(row);
  23. setColumn(column);
  24. setRowRelative(isRowRelative);
  25. setColRelative(isColumnRelative);
  26. }
  27. protected Ref2DPtgBase(Ref2DPtgBase other) {
  28. super(other);
  29. }
  30. protected Ref2DPtgBase(LittleEndianInput in) {
  31. readCoordinates(in);
  32. }
  33. protected Ref2DPtgBase(CellReference cr) {
  34. super(cr);
  35. }
  36. @Override
  37. public void write(LittleEndianOutput out) {
  38. out.writeByte(getSid() + getPtgClass());
  39. writeCoordinates(out);
  40. }
  41. @Override
  42. public final String toFormulaString() {
  43. return formatReferenceAsString();
  44. }
  45. @Override
  46. public final int getSize() {
  47. return SIZE;
  48. }
  49. }