KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*********************************************************************
2 *
3 * Copyright (C) 2004 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 java.text.DateFormat JavaDoc;
23 import java.util.Date JavaDoc;
24
25 import jxl.DateFormulaCell;
26 import jxl.biff.FormulaData;
27
28 /**
29  * Class for read number formula records
30  */

31 class ReadDateFormulaRecord extends ReadFormulaRecord
32   implements DateFormulaCell
33 {
34   /**
35    * Constructor
36    *
37    * @param f
38    */

39   public ReadDateFormulaRecord(FormulaData f)
40   {
41     super(f);
42   }
43
44   /**
45    * Gets the Date contents for this cell.
46    *
47    * @return the cell contents
48    */

49   public Date JavaDoc getDate()
50   {
51     return ( (DateFormulaCell) getReadFormula()).getDate();
52   }
53
54   /**
55    * Indicates whether the date value contained in this cell refers to a date,
56    * or merely a time
57    *
58    * @return TRUE if the value refers to a time
59    */

60   public boolean isTime()
61   {
62     return ( (DateFormulaCell) getReadFormula()).isTime();
63   }
64
65
66   /**
67    * Gets the DateFormat used to format this cell. This is the java
68    * equivalent of the Excel format
69    *
70    * @return the DateFormat used to format the cell
71    */

72   public DateFormat JavaDoc getDateFormat()
73   {
74     return ( (DateFormulaCell) getReadFormula()).getDateFormat();
75   }
76 }
77
Popular Tags