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 3.5KB

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