選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

BookmarkFirstDescriptor.java 2.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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.BKFAbstractType;
  19. import org.apache.poi.util.Internal;
  20. @Internal
  21. public final class BookmarkFirstDescriptor extends BKFAbstractType implements Duplicatable {
  22. public BookmarkFirstDescriptor() { }
  23. public BookmarkFirstDescriptor(BookmarkFirstDescriptor other) {
  24. super(other);
  25. }
  26. public BookmarkFirstDescriptor( byte[] data, int offset ) {
  27. fillFields( data, offset );
  28. }
  29. @Override
  30. public BookmarkFirstDescriptor copy() {
  31. return new BookmarkFirstDescriptor(this);
  32. }
  33. @Override
  34. public boolean equals( Object obj )
  35. {
  36. if ( this == obj )
  37. return true;
  38. if ( obj == null )
  39. return false;
  40. if ( getClass() != obj.getClass() )
  41. return false;
  42. BookmarkFirstDescriptor other = (BookmarkFirstDescriptor) obj;
  43. if ( field_1_ibkl != other.field_1_ibkl )
  44. return false;
  45. if ( field_2_bkf_flags != other.field_2_bkf_flags )
  46. return false;
  47. return true;
  48. }
  49. @Override
  50. public int hashCode() {
  51. return Objects.hash(field_1_ibkl,field_2_bkf_flags);
  52. }
  53. public boolean isEmpty()
  54. {
  55. return field_1_ibkl == 0 && field_2_bkf_flags == 0;
  56. }
  57. @Override
  58. public String toString()
  59. {
  60. if ( isEmpty() )
  61. return "[BKF] EMPTY";
  62. return super.toString();
  63. }
  64. }