KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jxl > biff > Type


1 /*********************************************************************
2 *
3 * Copyright (C) 2002 Andrew Khan
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 ***************************************************************************/

19
20 package jxl.biff;
21
22 /**
23  * An enumeration class which contains the biff types
24  */

25 public final class Type
26 {
27   /**
28    * The biff value for this type
29    */

30   public final int value;
31   /**
32    * An array of all types
33    */

34   private static Type[] types = new Type[0];
35
36   /**
37    * Constructor
38    * Sets the biff value and adds this type to the array of all types
39    *
40    * @param v the biff code for the type
41    */

42   private Type(int v)
43   {
44     value = v;
45
46     // Add to the list of available types
47
Type[] newTypes = new Type[types.length + 1];
48     System.arraycopy(types, 0, newTypes, 0, types.length);
49     newTypes[types.length] = this;
50     types = newTypes;
51   }
52
53   private static class ArbitraryType {};
54   private static ArbitraryType arbitrary = new ArbitraryType();
55
56   /**
57    * Constructor used for the creation of arbitrary types
58    */

59   private Type(int v, ArbitraryType arb)
60   {
61     value = v;
62   }
63
64   /**
65    * Standard hash code method
66    * @return the hash code
67    */

68   public int hashCode()
69   {
70     return value;
71   }
72
73   /**
74    * Standard equals method
75    * @param o the object to compare
76    * @return TRUE if the objects are equal, FALSE otherwise
77    */

78   public boolean equals(Object JavaDoc o)
79   {
80     if (o == this)
81     {
82       return true;
83     }
84
85     if (!(o instanceof Type))
86     {
87       return false;
88     }
89
90     Type t = (Type) o;
91
92     return value == t.value;
93   }
94
95   /**
96    * Gets the type object from its integer value
97    * @param v the internal code
98    * @return the type
99    */

100   public static Type getType(int v)
101   {
102     for (int i = 0; i < types.length; i++)
103     {
104       if (types[i].value == v)
105       {
106         return types[i];
107       }
108     }
109
110     return UNKNOWN;
111   }
112
113   /**
114    * Used to create an arbitrary record type. This method is only
115    * used during bespoke debugging process. The creation of an
116    * arbitrary type does not add it to the static list of known types
117    */

118   public static Type createType(int v)
119   {
120     return new Type(v, arbitrary);
121   }
122
123   /**
124    */

125   public static final Type BOF = new Type(0x809);
126   /**
127    */

128   public static final Type EOF = new Type(0x0a);
129   /**
130    */

131   public static final Type BOUNDSHEET = new Type(0x85);
132   /**
133    */

134   public static final Type SUPBOOK = new Type(0x1ae);
135   /**
136    */

137   public static final Type EXTERNSHEET = new Type(0x17);
138   /**
139    */

140   public static final Type DIMENSION = new Type(0x200);
141   /**
142    */

143   public static final Type BLANK = new Type(0x201);
144   /**
145    */

146   public static final Type MULBLANK = new Type(0xbe);
147   /**
148    */

149   public static final Type ROW = new Type(0x208);
150   /**
151    */

152   public static final Type NOTE = new Type(0x1c);
153   /**
154    */

155   public static final Type TXO = new Type(0x1b6);
156   /**
157    */

158   public static final Type RK = new Type(0x7e);
159   /**
160    */

161   public static final Type RK2 = new Type(0x27e);
162   /**
163    */

164   public static final Type MULRK = new Type(0xbd);
165   /**
166    */

167   public static final Type INDEX = new Type(0x20b);
168   /**
169    */

170   public static final Type DBCELL = new Type(0xd7);
171   /**
172    */

173   public static final Type SST = new Type(0xfc);
174   /**
175    */

176   public static final Type COLINFO = new Type(0x7d);
177   /**
178    */

179   public static final Type EXTSST = new Type(0xff);
180   /**
181    */

182   public static final Type CONTINUE = new Type(0x3c);
183   /**
184    */

185   public static final Type LABEL = new Type(0x204);
186   /**
187    */

188   public static final Type RSTRING = new Type(0xd6);
189   /**
190    */

191   public static final Type LABELSST = new Type(0xfd);
192   /**
193    */

194   public static final Type NUMBER = new Type(0x203);
195   /**
196    */

197   public static final Type NAME = new Type(0x18);
198   /**
199    */

200   public static final Type TABID = new Type(0x13d);
201   /**
202    */

203   public static final Type ARRAY = new Type(0x221);
204   /**
205    */

206   public static final Type STRING = new Type(0x207);
207   /**
208    */

209   public static final Type FORMULA = new Type(0x406);
210   /**
211    */

212   public static final Type FORMULA2 = new Type(0x6);
213   /**
214    */

215   public static final Type SHAREDFORMULA = new Type(0x4bc);
216   /**
217    */

218   public static final Type FORMAT = new Type(0x41e);
219   /**
220    */

221   public static final Type XF = new Type(0xe0);
222   /**
223    */

224   public static final Type BOOLERR = new Type(0x205);
225   /**
226    */

227   public static final Type INTERFACEHDR = new Type(0xe1);
228   /**
229    */

230   public static final Type SAVERECALC = new Type(0x5f);
231   /**
232    */

233   public static final Type INTERFACEEND = new Type(0xe2);
234   /**
235    */

236   public static final Type XCT = new Type(0x59);
237   /**
238    */

239   public static final Type CRN = new Type(0x5a);
240   /**
241    */

242   public static final Type DEFCOLWIDTH = new Type(0x55);
243   /**
244    */

245   public static final Type DEFAULTROWHEIGHT = new Type(0x225);
246   /**
247    */

248   public static final Type WRITEACCESS = new Type(0x5c);
249   /**
250    */

251   public static final Type WSBOOL = new Type(0x81);
252   /**
253    */

254   public static final Type CODEPAGE = new Type(0x42);
255   /**
256    */

257   public static final Type DSF = new Type(0x161);
258   /**
259    */

260   public static final Type FNGROUPCOUNT = new Type(0x9c);
261   /**
262    */

263   public static final Type COUNTRY = new Type(0x8c);
264   /**
265    */

266   public static final Type PROTECT = new Type(0x12);
267   /**
268    */

269   public static final Type SCENPROTECT = new Type(0xdd);
270   /**
271    */

272   public static final Type OBJPROTECT = new Type(0x63);
273   /**
274    */

275   public static final Type PRINTHEADERS = new Type(0x2a);
276   /**
277    */

278   public static final Type HEADER = new Type(0x14);
279   /**
280    */

281   public static final Type FOOTER = new Type(0x15);
282   /**
283    */

284   public static final Type HCENTER = new Type(0x83);
285   /**
286    */

287   public static final Type VCENTER = new Type(0x84);
288   /**
289    */

290   public static final Type FILEPASS = new Type(0x2f);
291   /**
292    */

293   public static final Type SETUP = new Type(0xa1);
294   /**
295    */

296   public static final Type PRINTGRIDLINES = new Type(0x2b);
297   /**
298    */

299   public static final Type GRIDSET = new Type(0x82);
300   /**
301    */

302   public static final Type GUTS = new Type(0x80);
303   /**
304    */

305   public static final Type WINDOWPROTECT = new Type(0x19);
306   /**
307    */

308   public static final Type PROT4REV = new Type(0x1af);
309   /**
310    */

311   public static final Type PROT4REVPASS = new Type(0x1bc);
312   /**
313    */

314   public static final Type PASSWORD = new Type(0x13);
315   /**
316    */

317   public static final Type REFRESHALL = new Type(0x1b7);
318   /**
319    */

320   public static final Type WINDOW1 = new Type(0x3d);
321   /**
322    */

323   public static final Type WINDOW2 = new Type(0x23e);
324   /**
325    */

326   public static final Type BACKUP = new Type(0x40);
327   /**
328    */

329   public static final Type HIDEOBJ = new Type(0x8d);
330   /**
331    */

332   public static final Type NINETEENFOUR = new Type(0x22);
333   /**
334    */

335   public static final Type PRECISION = new Type(0xe);
336   /**
337    */

338   public static final Type BOOKBOOL = new Type(0xda);
339   /**
340    */

341   public static final Type FONT = new Type(0x31);
342   /**
343    */

344   public static final Type MMS = new Type(0xc1);
345   /**
346    */

347   public static final Type CALCMODE = new Type(0x0d);
348   /**
349    */

350   public static final Type CALCCOUNT = new Type(0x0c);
351   /**
352    */

353   public static final Type REFMODE = new Type(0x0f);
354   /**
355    */

356   public static final Type TEMPLATE = new Type(0x60);
357   /**
358    */

359   public static final Type OBJPROJ = new Type(0xd3);
360   /**
361    */

362   public static final Type DELTA = new Type(0x10);
363   /**
364    */

365   public static final Type MERGEDCELLS = new Type(0xe5);
366   /**
367    */

368   public static final Type ITERATION = new Type(0x11);
369   /**
370    */

371   public static final Type STYLE = new Type(0x293);
372   /**
373    */

374   public static final Type USESELFS = new Type(0x160);
375   /**
376    */

377   public static final Type HORIZONTALPAGEBREAKS = new Type(0x1b);
378   /**
379    */

380   public static final Type SELECTION = new Type(0x1d);
381   /**
382    */

383   public static final Type HLINK = new Type(0x1b8);
384   /**
385    */

386   public static final Type OBJ = new Type(0x5d);
387   /**
388    */

389   public static final Type MSODRAWING = new Type(0xec);
390   /**
391    */

392   public static final Type MSODRAWINGGROUP = new Type(0xeb);
393   /**
394    */

395   public static final Type LEFTMARGIN = new Type(0x26);
396   /**
397    */

398   public static final Type RIGHTMARGIN = new Type(0x27);
399   /**
400    */

401   public static final Type TOPMARGIN = new Type(0x28);
402   /**
403    */

404   public static final Type BOTTOMMARGIN = new Type(0x29);
405   /**
406    */

407   public static final Type EXTERNNAME = new Type(0x23);
408   /**
409    */

410   public static final Type PALETTE = new Type(0x92);
411   /**
412    */

413   public static final Type PLS = new Type(0x4d);
414   /**
415    */

416   public static final Type SCL = new Type(0xa0);
417   /**
418    */

419   public static final Type PANE = new Type(0x41);
420   /**
421    */

422   public static final Type WEIRD1 = new Type(0xef);
423   /**
424    */

425   public static final Type SORT = new Type(0x90);
426   /**
427    */

428   public static final Type DV = new Type(0x1be);
429   /**
430    */

431   public static final Type DVAL = new Type(0x1b2);
432   /**
433    */

434   public static final Type BUTTONPROPERTYSET = new Type(0x1ba);
435
436   // Chart types
437
/**
438    */

439   public static final Type FONTX = new Type(0x1026);
440   /**
441    */

442   public static final Type IFMT = new Type(0x104e);
443   /**
444    */

445   public static final Type FBI = new Type(0x1060);
446   /**
447    */

448   public static final Type ALRUNS = new Type(0x1050);
449   /**
450    */

451   public static final Type UNKNOWN = new Type(0xffff);
452
453   // Unknown types
454
public static final Type U1C0 = new Type(0x1c0);
455   public static final Type U1C1 = new Type(0x1c1);
456
457 }
458
459
460
461
462
463
464
465
466
467
Popular Tags