Inspired by bug #44958 - Record level support for Data Tables. (No formula parser...
[poi.git] / src / java / org / apache / poi / hssf / record / SeriesChartGroupIndexRecord.java
blob076687d69f514a02319cb0ce17ab598b4a25e55a
2 /* ====================================================================
3 Licensed to the Apache Software Foundation (ASF) under one or more
4 contributor license agreements. See the NOTICE file distributed with
5 this work for additional information regarding copyright ownership.
6 The ASF licenses this file to You under the Apache License, Version 2.0
7 (the "License"); you may not use this file except in compliance with
8 the License. You may obtain a copy of the License at
10 http://www.apache.org/licenses/LICENSE-2.0
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License for the specific language governing permissions and
16 limitations under the License.
17 ==================================================================== */
20 package org.apache.poi.hssf.record;
24 import org.apache.poi.util.*;
26 /**
27 * The series chart group index record stores the index to the CHARTFORMAT record (0 based).
28 * NOTE: This source is automatically generated please do not modify this file. Either subclass or
29 * remove the record in src/records/definitions.
31 * @author Glen Stampoultzis (glens at apache.org)
33 public class SeriesChartGroupIndexRecord
34 extends Record
36 public final static short sid = 0x1045;
37 private short field_1_chartGroupIndex;
40 public SeriesChartGroupIndexRecord()
45 /**
46 * Constructs a SeriesChartGroupIndex record and sets its fields appropriately.
48 * @param in the RecordInputstream to read the record from
51 public SeriesChartGroupIndexRecord(RecordInputStream in)
53 super(in);
57 /**
58 * Checks the sid matches the expected side for this record
60 * @param id the expected sid.
62 protected void validateSid(short id)
64 if (id != sid)
66 throw new RecordFormatException("Not a SeriesChartGroupIndex record");
70 protected void fillFields(RecordInputStream in)
72 field_1_chartGroupIndex = in.readShort();
75 public String toString()
77 StringBuffer buffer = new StringBuffer();
79 buffer.append("[SERTOCRT]\n");
80 buffer.append(" .chartGroupIndex = ")
81 .append("0x").append(HexDump.toHex( getChartGroupIndex ()))
82 .append(" (").append( getChartGroupIndex() ).append(" )");
83 buffer.append(System.getProperty("line.separator"));
85 buffer.append("[/SERTOCRT]\n");
86 return buffer.toString();
89 public int serialize(int offset, byte[] data)
91 int pos = 0;
93 LittleEndian.putShort(data, 0 + offset, sid);
94 LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
96 LittleEndian.putShort(data, 4 + offset + pos, field_1_chartGroupIndex);
98 return getRecordSize();
102 * Size of record (exluding 4 byte header)
104 public int getRecordSize()
106 return 4 + 2;
109 public short getSid()
111 return sid;
114 public Object clone() {
115 SeriesChartGroupIndexRecord rec = new SeriesChartGroupIndexRecord();
117 rec.field_1_chartGroupIndex = field_1_chartGroupIndex;
118 return rec;
125 * Get the chart group index field for the SeriesChartGroupIndex record.
127 public short getChartGroupIndex()
129 return field_1_chartGroupIndex;
133 * Set the chart group index field for the SeriesChartGroupIndex record.
135 public void setChartGroupIndex(short field_1_chartGroupIndex)
137 this.field_1_chartGroupIndex = field_1_chartGroupIndex;
141 } // END OF CLASS