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.

Stshif.java 2.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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.StshifAbstractType;
  18. import org.apache.poi.util.Internal;
  19. /**
  20. * The StdfBase structure specifies general information about a style.
  21. */
  22. @Internal
  23. class Stshif extends StshifAbstractType
  24. {
  25. public Stshif()
  26. {
  27. }
  28. public Stshif( byte[] std, int offset )
  29. {
  30. fillFields( std, offset );
  31. }
  32. @Override
  33. public boolean equals( Object obj )
  34. {
  35. if ( this == obj )
  36. return true;
  37. if ( obj == null )
  38. return false;
  39. if ( getClass() != obj.getClass() )
  40. return false;
  41. Stshif other = (Stshif) obj;
  42. if ( field_1_cstd != other.field_1_cstd )
  43. return false;
  44. if ( field_2_cbSTDBaseInFile != other.field_2_cbSTDBaseInFile )
  45. return false;
  46. if ( field_3_info3 != other.field_3_info3 )
  47. return false;
  48. if ( field_4_stiMaxWhenSaved != other.field_4_stiMaxWhenSaved )
  49. return false;
  50. if ( field_5_istdMaxFixedWhenSaved != other.field_5_istdMaxFixedWhenSaved )
  51. return false;
  52. if ( field_6_nVerBuiltInNamesWhenSaved != other.field_6_nVerBuiltInNamesWhenSaved )
  53. return false;
  54. if ( field_7_ftcAsci != other.field_7_ftcAsci )
  55. return false;
  56. if ( field_8_ftcFE != other.field_8_ftcFE )
  57. return false;
  58. if ( field_9_ftcOther != other.field_9_ftcOther )
  59. return false;
  60. return true;
  61. }
  62. @Override
  63. public int hashCode() {
  64. return Objects.hash(field_1_cstd, field_2_cbSTDBaseInFile, field_3_info3, field_4_stiMaxWhenSaved,
  65. field_5_istdMaxFixedWhenSaved, field_6_nVerBuiltInNamesWhenSaved, field_7_ftcAsci, field_8_ftcFE, field_9_ftcOther);
  66. }
  67. public byte[] serialize()
  68. {
  69. byte[] result = new byte[getSize()];
  70. serialize( result, 0 );
  71. return result;
  72. }
  73. }