KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jxl > write > biff > NineteenFourRecord


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.write.biff;
21
22 import common.Assert;
23
24 import jxl.biff.Type;
25 import jxl.biff.IntegerHelper;
26 import jxl.biff.WritableRecordData;
27
28 /**
29  * A record which indicates whether or the 1904 date system is
30  * in use
31  */

32 class NineteenFourRecord extends WritableRecordData
33 {
34   /**
35    * Flag which indicates whether the 1904 date system is being used
36    */

37   private boolean nineteenFourDate;
38
39   /**
40    * The binary data for output to file
41    */

42   private byte[] data;
43
44   /**
45    * Constructor
46    *
47    * @param oldDate flag indicating whether the 1904 date system is in use
48    */

49   public NineteenFourRecord(boolean oldDate)
50   {
51     super(Type.NINETEENFOUR);
52
53     nineteenFourDate = oldDate;
54     data = new byte[2];
55
56     if (nineteenFourDate)
57     {
58       IntegerHelper.getTwoBytes(1, data, 0);
59     }
60   }
61
62   /**
63    * The binary data for output to file
64    * @return the binary data
65    */

66   public byte[] getData()
67   {
68     return data;
69   }
70 }
71
Popular Tags