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.

FootnoteReferenceDescriptor.java 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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.hwpf.model;
  16. import java.util.Objects;
  17. import org.apache.poi.common.Duplicatable;
  18. import org.apache.poi.hwpf.model.types.FRDAbstractType;
  19. import org.apache.poi.util.Internal;
  20. import org.apache.poi.util.Removal;
  21. @Internal
  22. public final class FootnoteReferenceDescriptor extends FRDAbstractType implements Duplicatable {
  23. public FootnoteReferenceDescriptor() { }
  24. public FootnoteReferenceDescriptor(FootnoteReferenceDescriptor other) {
  25. super(other);
  26. }
  27. public FootnoteReferenceDescriptor( byte[] data, int offset ) {
  28. fillFields( data, offset );
  29. }
  30. @Override
  31. @SuppressWarnings("squid:S2975")
  32. @Deprecated
  33. @Removal(version = "5.0.0")
  34. protected FootnoteReferenceDescriptor clone() {
  35. return copy();
  36. }
  37. @Override
  38. public FootnoteReferenceDescriptor copy() {
  39. return new FootnoteReferenceDescriptor(this);
  40. }
  41. @Override
  42. public boolean equals( Object obj )
  43. {
  44. if ( this == obj )
  45. return true;
  46. if ( obj == null )
  47. return false;
  48. if ( getClass() != obj.getClass() )
  49. return false;
  50. FootnoteReferenceDescriptor other = (FootnoteReferenceDescriptor) obj;
  51. if ( field_1_nAuto != other.field_1_nAuto )
  52. return false;
  53. return true;
  54. }
  55. @Override
  56. public int hashCode() {
  57. return Objects.hash(field_1_nAuto);
  58. }
  59. public boolean isEmpty()
  60. {
  61. return field_1_nAuto == 0;
  62. }
  63. @Override
  64. public String toString()
  65. {
  66. if ( isEmpty() )
  67. return "[FRD] EMPTY";
  68. return super.toString();
  69. }
  70. }