1 2 17 18 19 20 package org.apache.poi.hssf.record; 21 22 23 24 import org.apache.poi.util.*; 25 26 33 public class SeriesListRecord 34 extends Record 35 { 36 public final static short sid = 0x1016; 37 private short[] field_1_seriesNumbers; 38 39 40 public SeriesListRecord() 41 { 42 43 } 44 45 53 54 public SeriesListRecord(short id, short size, byte [] data) 55 { 56 super(id, size, data); 57 58 } 59 60 69 70 public SeriesListRecord(short id, short size, byte [] data, int offset) 71 { 72 super(id, size, data, offset); 73 74 } 75 76 81 protected void validateSid(short id) 82 { 83 if (id != sid) 84 { 85 throw new RecordFormatException("Not a SeriesList record"); 86 } 87 } 88 89 protected void fillFields(byte [] data, short size, int offset) 90 { 91 92 int pos = 0; 93 field_1_seriesNumbers = LittleEndian.getShortArray(data, pos + 0x0 + offset); 94 95 } 96 97 public String toString() 98 { 99 StringBuffer buffer = new StringBuffer (); 100 101 buffer.append("[SERIESLIST]\n"); 102 buffer.append(" .seriesNumbers = ") 103 .append(" (").append( getSeriesNumbers() ).append(" )"); 104 buffer.append(System.getProperty("line.separator")); 105 106 buffer.append("[/SERIESLIST]\n"); 107 return buffer.toString(); 108 } 109 110 public int serialize(int offset, byte[] data) 111 { 112 int pos = 0; 113 114 LittleEndian.putShort(data, 0 + offset, sid); 115 LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4)); 116 117 LittleEndian.putShortArray(data, 4 + offset + pos, field_1_seriesNumbers); 118 119 return getRecordSize(); 120 } 121 122 125 public int getRecordSize() 126 { 127 return 4 + field_1_seriesNumbers.length * 2 + 2; 128 } 129 130 public short getSid() 131 { 132 return this.sid; 133 } 134 135 public Object clone() { 136 SeriesListRecord rec = new SeriesListRecord(); 137 138 rec.field_1_seriesNumbers = field_1_seriesNumbers; 139 return rec; 140 } 141 142 143 144 145 148 public short[] getSeriesNumbers() 149 { 150 return field_1_seriesNumbers; 151 } 152 153 156 public void setSeriesNumbers(short[] field_1_seriesNumbers) 157 { 158 this.field_1_seriesNumbers = field_1_seriesNumbers; 159 } 160 161 162 } 164 165 166 167 | Popular Tags |