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.

FibBase.java 4.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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 org.apache.poi.hwpf.model.types.FibBaseAbstractType;
  17. import org.apache.poi.util.Internal;
  18. /**
  19. * Base part of the File information Block (FibBase). Holds the core part of the
  20. * FIB, from the first 32 bytes.
  21. * <p>
  22. * Class and fields descriptions are quoted from Microsoft Office Word 97-2007
  23. * Binary File Format and [MS-DOC] - v20110608 Word (.doc) Binary File Format.
  24. *
  25. * @author Andrew C. Oliver; Sergey Vladimirov; according to Microsoft Office
  26. * Word 97-2007 Binary File Format Specification [*.doc] and [MS-DOC] -
  27. * v20110608 Word (.doc) Binary File Format
  28. */
  29. @Internal
  30. public class FibBase extends FibBaseAbstractType {
  31. public FibBase() {
  32. }
  33. public FibBase( byte[] std, int offset ) {
  34. fillFields( std, offset );
  35. }
  36. @Override
  37. @SuppressWarnings( "deprecation" )
  38. public boolean equals( Object obj ) {
  39. if ( this == obj )
  40. return true;
  41. if ( obj == null )
  42. return false;
  43. if ( getClass() != obj.getClass() )
  44. return false;
  45. FibBase other = (FibBase) obj;
  46. if ( field_10_flags2 != other.field_10_flags2 )
  47. return false;
  48. if ( field_11_Chs != other.field_11_Chs )
  49. return false;
  50. if ( field_12_chsTables != other.field_12_chsTables )
  51. return false;
  52. if ( field_13_fcMin != other.field_13_fcMin )
  53. return false;
  54. if ( field_14_fcMac != other.field_14_fcMac )
  55. return false;
  56. if ( field_1_wIdent != other.field_1_wIdent )
  57. return false;
  58. if ( field_2_nFib != other.field_2_nFib )
  59. return false;
  60. if ( field_3_unused != other.field_3_unused )
  61. return false;
  62. if ( field_4_lid != other.field_4_lid )
  63. return false;
  64. if ( field_5_pnNext != other.field_5_pnNext )
  65. return false;
  66. if ( field_6_flags1 != other.field_6_flags1 )
  67. return false;
  68. if ( field_7_nFibBack != other.field_7_nFibBack )
  69. return false;
  70. if ( field_8_lKey != other.field_8_lKey )
  71. return false;
  72. if ( field_9_envr != other.field_9_envr )
  73. return false;
  74. return true;
  75. }
  76. @Override
  77. @SuppressWarnings( "deprecation" )
  78. public int hashCode() {
  79. final int prime = 31;
  80. int result = 1;
  81. result = prime * result + field_10_flags2;
  82. result = prime * result + field_11_Chs;
  83. result = prime * result + field_12_chsTables;
  84. result = prime * result + field_13_fcMin;
  85. result = prime * result + field_14_fcMac;
  86. result = prime * result + field_1_wIdent;
  87. result = prime * result + field_2_nFib;
  88. result = prime * result + field_3_unused;
  89. result = prime * result + field_4_lid;
  90. result = prime * result + field_5_pnNext;
  91. result = prime * result + field_6_flags1;
  92. result = prime * result + field_7_nFibBack;
  93. result = prime * result + field_8_lKey;
  94. result = prime * result + field_9_envr;
  95. return result;
  96. }
  97. }