01: /* ====================================================================
02: Licensed to the Apache Software Foundation (ASF) under one or more
03: contributor license agreements. See the NOTICE file distributed with
04: this work for additional information regarding copyright ownership.
05: The ASF licenses this file to You under the Apache License, Version 2.0
06: (the "License"); you may not use this file except in compliance with
07: the License. You may obtain a copy of the License at
08:
09: http://www.apache.org/licenses/LICENSE-2.0
10:
11: Unless required by applicable law or agreed to in writing, software
12: distributed under the License is distributed on an "AS IS" BASIS,
13: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: See the License for the specific language governing permissions and
15: limitations under the License.
16: ==================================================================== */
17:
18: package org.apache.poi.hssf.record.formula;
19:
20: import org.apache.poi.util.LittleEndian;
21: import org.apache.poi.util.BitField;
22: import org.apache.poi.util.BitFieldFactory;
23: import org.apache.poi.util.StringUtil;
24:
25: import org.apache.poi.hssf.util.CellReference;
26: import org.apache.poi.hssf.model.Workbook;
27: import org.apache.poi.hssf.record.RecordFormatException;
28: import org.apache.poi.hssf.record.RecordInputStream;
29: import org.apache.poi.hssf.record.SSTRecord;
30: import org.apache.poi.hssf.record.UnicodeString;
31:
32: /**
33: * ArrayPtgA - handles arrays
34: *
35: * @author Jason Height (jheight at chariot dot net dot au)
36: */
37:
38: public class ArrayPtgA extends ArrayPtg {
39: public final static byte sid = 0x60;
40:
41: protected ArrayPtgA() {
42: super ();
43: //Required for clone methods
44: }
45:
46: public ArrayPtgA(RecordInputStream in) {
47: super (in);
48: }
49:
50: public Object clone() {
51: ArrayPtgA ptg = new ArrayPtgA();
52: ptg.field_1_reserved = field_1_reserved;
53: ptg.field_2_reserved = field_2_reserved;
54: ptg.field_3_reserved = field_3_reserved;
55: ptg.field_4_reserved = field_4_reserved;
56: ptg.field_5_reserved = field_5_reserved;
57: ptg.field_6_reserved = field_6_reserved;
58: ptg.field_7_reserved = field_7_reserved;
59:
60: ptg.token_1_columns = token_1_columns;
61: ptg.token_2_rows = token_2_rows;
62: ptg.token_3_arrayValues = new Object[getColumnCount()][getRowCount()];
63: for (int x = 0; x < getColumnCount(); x++) {
64: for (int y = 0; y < getRowCount(); y++) {
65: ptg.token_3_arrayValues[x][y] = token_3_arrayValues[x][y];
66: }
67: }
68: ptg.setClass(ptgClass);
69: return ptg;
70: }
71: }
|