Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

RefErrorPtg.java 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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 java.util.Map;
  17. import java.util.function.Supplier;
  18. import org.apache.poi.ss.usermodel.FormulaError;
  19. import org.apache.poi.util.GenericRecordUtil;
  20. import org.apache.poi.util.LittleEndianInput;
  21. import org.apache.poi.util.LittleEndianOutput;
  22. /**
  23. * RefError - handles deleted cell reference
  24. */
  25. public final class RefErrorPtg extends OperandPtg {
  26. private static final int SIZE = 5;
  27. public static final byte sid = 0x2A;
  28. private int field_1_reserved;
  29. public RefErrorPtg() {
  30. field_1_reserved = 0;
  31. }
  32. public RefErrorPtg(RefErrorPtg other) {
  33. super(other);
  34. field_1_reserved = other.field_1_reserved;
  35. }
  36. public RefErrorPtg(LittleEndianInput in) {
  37. field_1_reserved = in.readInt();
  38. }
  39. public void write(LittleEndianOutput out) {
  40. out.writeByte(sid + getPtgClass());
  41. out.writeInt(field_1_reserved);
  42. }
  43. @Override
  44. public byte getSid() {
  45. return sid;
  46. }
  47. public int getSize() {
  48. return SIZE;
  49. }
  50. public String toFormulaString() {
  51. return FormulaError.REF.getString();
  52. }
  53. public byte getDefaultOperandClass() {
  54. return Ptg.CLASS_REF;
  55. }
  56. @Override
  57. public RefErrorPtg copy() {
  58. return new RefErrorPtg(this);
  59. }
  60. @Override
  61. public Map<String, Supplier<?>> getGenericProperties() {
  62. return GenericRecordUtil.getGenericProperties("reserved", () -> field_1_reserved);
  63. }
  64. }