1 2 17 18 19 package org.apache.poi.hssf.record; 20 21 import org.apache.poi.util.LittleEndian; 22 23 31 32 public class BookBoolRecord 33 extends Record 34 { 35 public final static short sid = 0xDA; 36 private short field_1_save_link_values; 37 38 public BookBoolRecord() 39 { 40 } 41 42 49 50 public BookBoolRecord(short id, short size, byte [] data) 51 { 52 super(id, size, data); 53 } 54 55 63 64 public BookBoolRecord(short id, short size, byte [] data, int offset) 65 { 66 super(id, size, data, offset); 67 } 68 69 protected void validateSid(short id) 70 { 71 if (id != sid) 72 { 73 throw new RecordFormatException("NOT A BOOKBOOL RECORD"); 74 } 75 } 76 77 protected void fillFields(byte [] data, short size, int offset) 78 { 79 field_1_save_link_values = LittleEndian.getShort(data, 0 + offset); 80 } 81 82 87 88 public void setSaveLinkValues(short flag) 89 { 90 field_1_save_link_values = flag; 91 } 92 93 98 99 public short getSaveLinkValues() 100 { 101 return field_1_save_link_values; 102 } 103 104 public String toString() 105 { 106 StringBuffer buffer = new StringBuffer (); 107 108 buffer.append("[BOOKBOOL]\n"); 109 buffer.append(" .savelinkvalues = ") 110 .append(Integer.toHexString(getSaveLinkValues())).append("\n"); 111 buffer.append("[/BOOKBOOL]\n"); 112 return buffer.toString(); 113 } 114 115 public int serialize(int offset, byte [] data) 116 { 117 LittleEndian.putShort(data, 0 + offset, sid); 118 LittleEndian.putShort(data, 2 + offset, 119 (( short ) 0x02)); LittleEndian.putShort(data, 4 + offset, field_1_save_link_values); 121 return getRecordSize(); 122 } 123 124 public int getRecordSize() 125 { 126 return 6; 127 } 128 129 public short getSid() 130 { 131 return this.sid; 132 } 133 } 134 | Popular Tags |