KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jxl > biff > RecordData


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 import jxl.read.biff.Record;
23
24 /**
25  * The record data within a record
26  */

27 public abstract class RecordData
28 {
29   /**
30    * The raw data
31    */

32   private Record record;
33
34   /**
35    * The Biff code for this record. This is set up when the record is
36    * used for writing
37    */

38   private int code;
39
40   /**
41    * Constructs this object from the raw data
42    *
43    * @param r the raw data
44    */

45   protected RecordData(Record r)
46   {
47     record = r;
48     code = r.getCode();
49   }
50
51   /**
52    * Constructor used by the writable records
53    *
54    * @param t the type
55    */

56   protected RecordData(Type t)
57   {
58     code = t.value;
59   }
60
61   /**
62    * Returns the raw data to its subclasses
63    *
64    * @return the raw data
65    */

66   protected Record getRecord()
67   {
68     return record;
69   }
70
71   /**
72    * Accessor for the code
73    *
74    * @return the code
75    */

76   protected final int getCode()
77   {
78     return code;
79   }
80 }
81
82
83
84
85
86
87
88
89
Popular Tags