KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > poi > hssf > record > formula > MemErrPtg


1
2 /* ====================================================================
3    Copyright 2003-2004 Apache Software Foundation
4
5    Licensed under the Apache License, Version 2.0 (the "License");
6    you may not use this file except in compliance with the License.
7    You may obtain a copy of the License at
8
9        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
19 /*
20  * MemErrPtg.java
21  *
22  * Created on November 21, 2001, 8:46 AM
23  */

24 package org.apache.poi.hssf.record.formula;
25
26 import org.apache.poi.util.LittleEndian;
27 import org.apache.poi.hssf.model.Workbook;
28
29 /**
30  *
31  * @author andy
32  * @author Jason Height (jheight at chariot dot net dot au)
33  */

34
35 public class MemErrPtg
36     extends Ptg
37 {
38     public final static short sid = 0x27;
39     private final static int SIZE = 7;
40     private int field_1_reserved;
41     private short field_2_subex_len;
42
43     /** Creates new MemErrPtg */
44
45     public MemErrPtg()
46     {
47     }
48
49     public MemErrPtg(byte [] data, int offset)
50     {
51         field_1_reserved = LittleEndian.getInt(data, 0);
52         field_2_subex_len = LittleEndian.getShort(data, 4);
53     }
54
55     public void setReserved(int res)
56     {
57         field_1_reserved = res;
58     }
59
60     public int getReserved()
61     {
62         return field_1_reserved;
63     }
64
65     public void setSubexpressionLength(short subexlen)
66     {
67         field_2_subex_len = subexlen;
68     }
69
70     public short getSubexpressionLength()
71     {
72         return field_2_subex_len;
73     }
74
75     public void writeBytes(byte [] array, int offset)
76     {
77     }
78
79     public int getSize()
80     {
81         return SIZE;
82     }
83
84     public String JavaDoc toFormulaString(Workbook book)
85     {
86         return "ERR#";
87     }
88     public byte getDefaultOperandClass() {return Ptg.CLASS_VALUE;}
89
90     public Object JavaDoc clone() {
91       MemErrPtg ptg = new MemErrPtg();
92       ptg.field_1_reserved = field_1_reserved;
93       ptg.field_2_subex_len = field_2_subex_len;
94       return ptg;
95     }
96 }
97
Popular Tags