KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > poi > hwpf > model > types > FIBAbstractType


1
2 /* ====================================================================
3    Copyright 2002-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 package org.apache.poi.hwpf.model.types;
21
22
23
24 import org.apache.poi.util.BitField;
25 import org.apache.poi.util.LittleEndian;
26 import org.apache.poi.util.StringUtil;
27 import org.apache.poi.util.HexDump;
28 import org.apache.poi.hdf.model.hdftypes.HDFType;
29 import org.apache.poi.hwpf.usermodel.*;
30
31 /**
32  * File information Block.
33  * NOTE: This source is automatically generated please do not modify this file. Either subclass or
34  * remove the record in src/records/definitions.
35
36  * @author Andrew C. Oliver
37  */

38 public abstract class FIBAbstractType
39     implements HDFType
40 {
41
42     protected int field_1_wIdent;
43     protected int field_2_nFib;
44     protected int field_3_nProduct;
45     protected int field_4_lid;
46     protected int field_5_pnNext;
47     protected short field_6_options;
48         private static BitField fDot = new BitField(0x0001);
49         private static BitField fGlsy = new BitField(0x0002);
50         private static BitField fComplex = new BitField(0x0004);
51         private static BitField fHasPic = new BitField(0x0008);
52         private static BitField cQuickSaves = new BitField(0x00F0);
53         private static BitField fEncrypted = new BitField(0x0100);
54         private static BitField fWhichTblStm = new BitField(0x0200);
55         private static BitField fReadOnlyRecommended = new BitField(0x0400);
56         private static BitField fWriteReservation = new BitField(0x0800);
57         private static BitField fExtChar = new BitField(0x1000);
58         private static BitField fLoadOverride = new BitField(0x2000);
59         private static BitField fFarEast = new BitField(0x4000);
60         private static BitField fCrypto = new BitField(0x8000);
61     protected int field_7_nFibBack;
62     protected int field_8_lKey;
63     protected int field_9_envr;
64     protected short field_10_history;
65         private static BitField fMac = new BitField(0x0001);
66         private static BitField fEmptySpecial = new BitField(0x0002);
67         private static BitField fLoadOverridePage = new BitField(0x0004);
68         private static BitField fFutureSavedUndo = new BitField(0x0008);
69         private static BitField fWord97Saved = new BitField(0x0010);
70         private static BitField fSpare0 = new BitField(0x00FE);
71     protected int field_11_chs;
72     protected int field_12_chsTables;
73     protected int field_13_fcMin;
74     protected int field_14_fcMac;
75
76
77     public FIBAbstractType()
78     {
79
80     }
81
82     protected void fillFields(byte [] data, int offset)
83     {
84         field_1_wIdent = LittleEndian.getShort(data, 0x0 + offset);
85         field_2_nFib = LittleEndian.getShort(data, 0x2 + offset);
86         field_3_nProduct = LittleEndian.getShort(data, 0x4 + offset);
87         field_4_lid = LittleEndian.getShort(data, 0x6 + offset);
88         field_5_pnNext = LittleEndian.getShort(data, 0x8 + offset);
89         field_6_options = LittleEndian.getShort(data, 0xa + offset);
90         field_7_nFibBack = LittleEndian.getShort(data, 0xc + offset);
91         field_8_lKey = LittleEndian.getShort(data, 0xe + offset);
92         field_9_envr = LittleEndian.getShort(data, 0x10 + offset);
93         field_10_history = LittleEndian.getShort(data, 0x12 + offset);
94         field_11_chs = LittleEndian.getShort(data, 0x14 + offset);
95         field_12_chsTables = LittleEndian.getShort(data, 0x16 + offset);
96         field_13_fcMin = LittleEndian.getInt(data, 0x18 + offset);
97         field_14_fcMac = LittleEndian.getInt(data, 0x1c + offset);
98
99     }
100
101     public void serialize(byte[] data, int offset)
102     {
103         LittleEndian.putShort(data, 0x0 + offset, (short)field_1_wIdent);;
104         LittleEndian.putShort(data, 0x2 + offset, (short)field_2_nFib);;
105         LittleEndian.putShort(data, 0x4 + offset, (short)field_3_nProduct);;
106         LittleEndian.putShort(data, 0x6 + offset, (short)field_4_lid);;
107         LittleEndian.putShort(data, 0x8 + offset, (short)field_5_pnNext);;
108         LittleEndian.putShort(data, 0xa + offset, (short)field_6_options);;
109         LittleEndian.putShort(data, 0xc + offset, (short)field_7_nFibBack);;
110         LittleEndian.putShort(data, 0xe + offset, (short)field_8_lKey);;
111         LittleEndian.putShort(data, 0x10 + offset, (short)field_9_envr);;
112         LittleEndian.putShort(data, 0x12 + offset, (short)field_10_history);;
113         LittleEndian.putShort(data, 0x14 + offset, (short)field_11_chs);;
114         LittleEndian.putShort(data, 0x16 + offset, (short)field_12_chsTables);;
115         LittleEndian.putInt(data, 0x18 + offset, field_13_fcMin);;
116         LittleEndian.putInt(data, 0x1c + offset, field_14_fcMac);;
117
118     }
119
120     public String JavaDoc toString()
121     {
122         StringBuffer JavaDoc buffer = new StringBuffer JavaDoc();
123
124         buffer.append("[FIB]\n");
125
126         buffer.append(" .wIdent = ");
127         buffer.append(" (").append(getWIdent()).append(" )\n");
128
129         buffer.append(" .nFib = ");
130         buffer.append(" (").append(getNFib()).append(" )\n");
131
132         buffer.append(" .nProduct = ");
133         buffer.append(" (").append(getNProduct()).append(" )\n");
134
135         buffer.append(" .lid = ");
136         buffer.append(" (").append(getLid()).append(" )\n");
137
138         buffer.append(" .pnNext = ");
139         buffer.append(" (").append(getPnNext()).append(" )\n");
140
141         buffer.append(" .options = ");
142         buffer.append(" (").append(getOptions()).append(" )\n");
143         buffer.append(" .fDot = ").append(isFDot()).append('\n');
144         buffer.append(" .fGlsy = ").append(isFGlsy()).append('\n');
145         buffer.append(" .fComplex = ").append(isFComplex()).append('\n');
146         buffer.append(" .fHasPic = ").append(isFHasPic()).append('\n');
147         buffer.append(" .cQuickSaves = ").append(getCQuickSaves()).append('\n');
148         buffer.append(" .fEncrypted = ").append(isFEncrypted()).append('\n');
149         buffer.append(" .fWhichTblStm = ").append(isFWhichTblStm()).append('\n');
150         buffer.append(" .fReadOnlyRecommended = ").append(isFReadOnlyRecommended()).append('\n');
151         buffer.append(" .fWriteReservation = ").append(isFWriteReservation()).append('\n');
152         buffer.append(" .fExtChar = ").append(isFExtChar()).append('\n');
153         buffer.append(" .fLoadOverride = ").append(isFLoadOverride()).append('\n');
154         buffer.append(" .fFarEast = ").append(isFFarEast()).append('\n');
155         buffer.append(" .fCrypto = ").append(isFCrypto()).append('\n');
156
157         buffer.append(" .nFibBack = ");
158         buffer.append(" (").append(getNFibBack()).append(" )\n");
159
160         buffer.append(" .lKey = ");
161         buffer.append(" (").append(getLKey()).append(" )\n");
162
163         buffer.append(" .envr = ");
164         buffer.append(" (").append(getEnvr()).append(" )\n");
165
166         buffer.append(" .history = ");
167         buffer.append(" (").append(getHistory()).append(" )\n");
168         buffer.append(" .fMac = ").append(isFMac()).append('\n');
169         buffer.append(" .fEmptySpecial = ").append(isFEmptySpecial()).append('\n');
170         buffer.append(" .fLoadOverridePage = ").append(isFLoadOverridePage()).append('\n');
171         buffer.append(" .fFutureSavedUndo = ").append(isFFutureSavedUndo()).append('\n');
172         buffer.append(" .fWord97Saved = ").append(isFWord97Saved()).append('\n');
173         buffer.append(" .fSpare0 = ").append(getFSpare0()).append('\n');
174
175         buffer.append(" .chs = ");
176         buffer.append(" (").append(getChs()).append(" )\n");
177
178         buffer.append(" .chsTables = ");
179         buffer.append(" (").append(getChsTables()).append(" )\n");
180
181         buffer.append(" .fcMin = ");
182         buffer.append(" (").append(getFcMin()).append(" )\n");
183
184         buffer.append(" .fcMac = ");
185         buffer.append(" (").append(getFcMac()).append(" )\n");
186
187         buffer.append("[/FIB]\n");
188         return buffer.toString();
189     }
190
191     /**
192      * Size of record (exluding 4 byte header)
193      */

194     public int getSize()
195     {
196         return 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 4 + 4;
197     }
198
199
200
201     /**
202      * Get the wIdent field for the FIB record.
203      */

204     public int getWIdent()
205     {
206         return field_1_wIdent;
207     }
208
209     /**
210      * Set the wIdent field for the FIB record.
211      */

212     public void setWIdent(int field_1_wIdent)
213     {
214         this.field_1_wIdent = field_1_wIdent;
215     }
216
217     /**
218      * Get the nFib field for the FIB record.
219      */

220     public int getNFib()
221     {
222         return field_2_nFib;
223     }
224
225     /**
226      * Set the nFib field for the FIB record.
227      */

228     public void setNFib(int field_2_nFib)
229     {
230         this.field_2_nFib = field_2_nFib;
231     }
232
233     /**
234      * Get the nProduct field for the FIB record.
235      */

236     public int getNProduct()
237     {
238         return field_3_nProduct;
239     }
240
241     /**
242      * Set the nProduct field for the FIB record.
243      */

244     public void setNProduct(int field_3_nProduct)
245     {
246         this.field_3_nProduct = field_3_nProduct;
247     }
248
249     /**
250      * Get the lid field for the FIB record.
251      */

252     public int getLid()
253     {
254         return field_4_lid;
255     }
256
257     /**
258      * Set the lid field for the FIB record.
259      */

260     public void setLid(int field_4_lid)
261     {
262         this.field_4_lid = field_4_lid;
263     }
264
265     /**
266      * Get the pnNext field for the FIB record.
267      */

268     public int getPnNext()
269     {
270         return field_5_pnNext;
271     }
272
273     /**
274      * Set the pnNext field for the FIB record.
275      */

276     public void setPnNext(int field_5_pnNext)
277     {
278         this.field_5_pnNext = field_5_pnNext;
279     }
280
281     /**
282      * Get the options field for the FIB record.
283      */

284     public short getOptions()
285     {
286         return field_6_options;
287     }
288
289     /**
290      * Set the options field for the FIB record.
291      */

292     public void setOptions(short field_6_options)
293     {
294         this.field_6_options = field_6_options;
295     }
296
297     /**
298      * Get the nFibBack field for the FIB record.
299      */

300     public int getNFibBack()
301     {
302         return field_7_nFibBack;
303     }
304
305     /**
306      * Set the nFibBack field for the FIB record.
307      */

308     public void setNFibBack(int field_7_nFibBack)
309     {
310         this.field_7_nFibBack = field_7_nFibBack;
311     }
312
313     /**
314      * Get the lKey field for the FIB record.
315      */

316     public int getLKey()
317     {
318         return field_8_lKey;
319     }
320
321     /**
322      * Set the lKey field for the FIB record.
323      */

324     public void setLKey(int field_8_lKey)
325     {
326         this.field_8_lKey = field_8_lKey;
327     }
328
329     /**
330      * Get the envr field for the FIB record.
331      */

332     public int getEnvr()
333     {
334         return field_9_envr;
335     }
336
337     /**
338      * Set the envr field for the FIB record.
339      */

340     public void setEnvr(int field_9_envr)
341     {
342         this.field_9_envr = field_9_envr;
343     }
344
345     /**
346      * Get the history field for the FIB record.
347      */

348     public short getHistory()
349     {
350         return field_10_history;
351     }
352
353     /**
354      * Set the history field for the FIB record.
355      */

356     public void setHistory(short field_10_history)
357     {
358         this.field_10_history = field_10_history;
359     }
360
361     /**
362      * Get the chs field for the FIB record.
363      */

364     public int getChs()
365     {
366         return field_11_chs;
367     }
368
369     /**
370      * Set the chs field for the FIB record.
371      */

372     public void setChs(int field_11_chs)
373     {
374         this.field_11_chs = field_11_chs;
375     }
376
377     /**
378      * Get the chsTables field for the FIB record.
379      */

380     public int getChsTables()
381     {
382         return field_12_chsTables;
383     }
384
385     /**
386      * Set the chsTables field for the FIB record.
387      */

388     public void setChsTables(int field_12_chsTables)
389     {
390         this.field_12_chsTables = field_12_chsTables;
391     }
392
393     /**
394      * Get the fcMin field for the FIB record.
395      */

396     public int getFcMin()
397     {
398         return field_13_fcMin;
399     }
400
401     /**
402      * Set the fcMin field for the FIB record.
403      */

404     public void setFcMin(int field_13_fcMin)
405     {
406         this.field_13_fcMin = field_13_fcMin;
407     }
408
409     /**
410      * Get the fcMac field for the FIB record.
411      */

412     public int getFcMac()
413     {
414         return field_14_fcMac;
415     }
416
417     /**
418      * Set the fcMac field for the FIB record.
419      */

420     public void setFcMac(int field_14_fcMac)
421     {
422         this.field_14_fcMac = field_14_fcMac;
423     }
424
425     /**
426      * Sets the fDot field value.
427      *
428      */

429     public void setFDot(boolean value)
430     {
431         field_6_options = (short)fDot.setBoolean(field_6_options, value);
432
433
434     }
435
436     /**
437      *
438      * @return the fDot field value.
439      */

440     public boolean isFDot()
441     {
442         return fDot.isSet(field_6_options);
443
444     }
445
446     /**
447      * Sets the fGlsy field value.
448      *
449      */

450     public void setFGlsy(boolean value)
451     {
452         field_6_options = (short)fGlsy.setBoolean(field_6_options, value);
453
454
455     }
456
457     /**
458      *
459      * @return the fGlsy field value.
460      */

461     public boolean isFGlsy()
462     {
463         return fGlsy.isSet(field_6_options);
464
465     }
466
467     /**
468      * Sets the fComplex field value.
469      *
470      */

471     public void setFComplex(boolean value)
472     {
473         field_6_options = (short)fComplex.setBoolean(field_6_options, value);
474
475
476     }
477
478     /**
479      *
480      * @return the fComplex field value.
481      */

482     public boolean isFComplex()
483     {
484         return fComplex.isSet(field_6_options);
485
486     }
487
488     /**
489      * Sets the fHasPic field value.
490      *
491      */

492     public void setFHasPic(boolean value)
493     {
494         field_6_options = (short)fHasPic.setBoolean(field_6_options, value);
495
496
497     }
498
499     /**
500      *
501      * @return the fHasPic field value.
502      */

503     public boolean isFHasPic()
504     {
505         return fHasPic.isSet(field_6_options);
506
507     }
508
509     /**
510      * Sets the cQuickSaves field value.
511      *
512      */

513     public void setCQuickSaves(byte value)
514     {
515         field_6_options = (short)cQuickSaves.setValue(field_6_options, value);
516
517
518     }
519
520     /**
521      *
522      * @return the cQuickSaves field value.
523      */

524     public byte getCQuickSaves()
525     {
526         return ( byte )cQuickSaves.getValue(field_6_options);
527
528     }
529
530     /**
531      * Sets the fEncrypted field value.
532      *
533      */

534     public void setFEncrypted(boolean value)
535     {
536         field_6_options = (short)fEncrypted.setBoolean(field_6_options, value);
537
538
539     }
540
541     /**
542      *
543      * @return the fEncrypted field value.
544      */

545     public boolean isFEncrypted()
546     {
547         return fEncrypted.isSet(field_6_options);
548
549     }
550
551     /**
552      * Sets the fWhichTblStm field value.
553      *
554      */

555     public void setFWhichTblStm(boolean value)
556     {
557         field_6_options = (short)fWhichTblStm.setBoolean(field_6_options, value);
558
559
560     }
561
562     /**
563      *
564      * @return the fWhichTblStm field value.
565      */

566     public boolean isFWhichTblStm()
567     {
568         return fWhichTblStm.isSet(field_6_options);
569
570     }
571
572     /**
573      * Sets the fReadOnlyRecommended field value.
574      *
575      */

576     public void setFReadOnlyRecommended(boolean value)
577     {
578         field_6_options = (short)fReadOnlyRecommended.setBoolean(field_6_options, value);
579
580
581     }
582
583     /**
584      *
585      * @return the fReadOnlyRecommended field value.
586      */

587     public boolean isFReadOnlyRecommended()
588     {
589         return fReadOnlyRecommended.isSet(field_6_options);
590
591     }
592
593     /**
594      * Sets the fWriteReservation field value.
595      *
596      */

597     public void setFWriteReservation(boolean value)
598     {
599         field_6_options = (short)fWriteReservation.setBoolean(field_6_options, value);
600
601
602     }
603
604     /**
605      *
606      * @return the fWriteReservation field value.
607      */

608     public boolean isFWriteReservation()
609     {
610         return fWriteReservation.isSet(field_6_options);
611
612     }
613
614     /**
615      * Sets the fExtChar field value.
616      *
617      */

618     public void setFExtChar(boolean value)
619     {
620         field_6_options = (short)fExtChar.setBoolean(field_6_options, value);
621
622
623     }
624
625     /**
626      *
627      * @return the fExtChar field value.
628      */

629     public boolean isFExtChar()
630     {
631         return fExtChar.isSet(field_6_options);
632
633     }
634
635     /**
636      * Sets the fLoadOverride field value.
637      *
638      */

639     public void setFLoadOverride(boolean value)
640     {
641         field_6_options = (short)fLoadOverride.setBoolean(field_6_options, value);
642
643
644     }
645
646     /**
647      *
648      * @return the fLoadOverride field value.
649      */

650     public boolean isFLoadOverride()
651     {
652         return fLoadOverride.isSet(field_6_options);
653
654     }
655
656     /**
657      * Sets the fFarEast field value.
658      *
659      */

660     public void setFFarEast(boolean value)
661     {
662         field_6_options = (short)fFarEast.setBoolean(field_6_options, value);
663
664
665     }
666
667     /**
668      *
669      * @return the fFarEast field value.
670      */

671     public boolean isFFarEast()
672     {
673         return fFarEast.isSet(field_6_options);
674
675     }
676
677     /**
678      * Sets the fCrypto field value.
679      *
680      */

681     public void setFCrypto(boolean value)
682     {
683         field_6_options = (short)fCrypto.setBoolean(field_6_options, value);
684
685
686     }
687
688     /**
689      *
690      * @return the fCrypto field value.
691      */

692     public boolean isFCrypto()
693     {
694         return fCrypto.isSet(field_6_options);
695
696     }
697
698     /**
699      * Sets the fMac field value.
700      *
701      */

702     public void setFMac(boolean value)
703     {
704         field_10_history = (short)fMac.setBoolean(field_10_history, value);
705
706
707     }
708
709     /**
710      *
711      * @return the fMac field value.
712      */

713     public boolean isFMac()
714     {
715         return fMac.isSet(field_10_history);
716
717     }
718
719     /**
720      * Sets the fEmptySpecial field value.
721      *
722      */

723     public void setFEmptySpecial(boolean value)
724     {
725         field_10_history = (short)fEmptySpecial.setBoolean(field_10_history, value);
726
727
728     }
729
730     /**
731      *
732      * @return the fEmptySpecial field value.
733      */

734     public boolean isFEmptySpecial()
735     {
736         return fEmptySpecial.isSet(field_10_history);
737
738     }
739
740     /**
741      * Sets the fLoadOverridePage field value.
742      *
743      */

744     public void setFLoadOverridePage(boolean value)
745     {
746         field_10_history = (short)fLoadOverridePage.setBoolean(field_10_history, value);
747
748
749     }
750
751     /**
752      *
753      * @return the fLoadOverridePage field value.
754      */

755     public boolean isFLoadOverridePage()
756     {
757         return fLoadOverridePage.isSet(field_10_history);
758
759     }
760
761     /**
762      * Sets the fFutureSavedUndo field value.
763      *
764      */

765     public void setFFutureSavedUndo(boolean value)
766     {
767         field_10_history = (short)fFutureSavedUndo.setBoolean(field_10_history, value);
768
769
770     }
771
772     /**
773      *
774      * @return the fFutureSavedUndo field value.
775      */

776     public boolean isFFutureSavedUndo()
777     {
778         return fFutureSavedUndo.isSet(field_10_history);
779
780     }
781
782     /**
783      * Sets the fWord97Saved field value.
784      *
785      */

786     public void setFWord97Saved(boolean value)
787     {
788         field_10_history = (short)fWord97Saved.setBoolean(field_10_history, value);
789
790
791     }
792
793     /**
794      *
795      * @return the fWord97Saved field value.
796      */

797     public boolean isFWord97Saved()
798     {
799         return fWord97Saved.isSet(field_10_history);
800
801     }
802
803     /**
804      * Sets the fSpare0 field value.
805      *
806      */

807     public void setFSpare0(byte value)
808     {
809         field_10_history = (short)fSpare0.setValue(field_10_history, value);
810
811
812     }
813
814     /**
815      *
816      * @return the fSpare0 field value.
817      */

818     public byte getFSpare0()
819     {
820         return ( byte )fSpare0.getValue(field_10_history);
821
822     }
823
824
825 } // END OF CLASS
826

827
828
829
830
Popular Tags