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 FnGroupCountRecord 33 extends Record 34 { 35 public final static short sid = 0x9c; 36 37 40 41 public final static short COUNT = 14; 42 private short field_1_count; 43 44 public FnGroupCountRecord() 45 { 46 } 47 48 55 56 public FnGroupCountRecord(short id, short size, byte [] data) 57 { 58 super(id, size, data); 59 } 60 61 69 70 public FnGroupCountRecord(short id, short size, byte [] data, int offset) 71 { 72 super(id, size, data, offset); 73 } 74 75 protected void validateSid(short id) 76 { 77 if (id != sid) 78 { 79 throw new RecordFormatException("NOT A FNGROUPCOUNT RECORD"); 80 } 81 } 82 83 protected void fillFields(byte [] data, short size, int offset) 84 { 85 field_1_count = LittleEndian.getShort(data, 0 + offset); 86 } 87 88 93 94 public void setCount(short count) 95 { 96 field_1_count = count; 97 } 98 99 104 105 public short getCount() 106 { 107 return field_1_count; 108 } 109 110 public String toString() 111 { 112 StringBuffer buffer = new StringBuffer (); 113 114 buffer.append("[FNGROUPCOUNT]\n"); 115 buffer.append(" .count = ").append(getCount()) 116 .append("\n"); 117 buffer.append("[/FNGROUPCOUNT]\n"); 118 return buffer.toString(); 119 } 120 121 public int serialize(int offset, byte [] data) 122 { 123 LittleEndian.putShort(data, 0 + offset, sid); 124 LittleEndian.putShort(data, 2 + offset, 125 (( short ) 0x02)); LittleEndian.putShort(data, 4 + offset, getCount()); 127 return getRecordSize(); 128 } 129 130 public int getRecordSize() 131 { 132 return 6; 133 } 134 135 public short getSid() 136 { 137 return this.sid; 138 } 139 } 140 | Popular Tags |