KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jxl > write > Formula


1 /*********************************************************************
2 *
3 * Copyright (C) 2001 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;
21
22 import jxl.write.biff.FormulaRecord;
23 import jxl.format.CellFormat;
24
25 /**
26  * A cell, created by user applications, which contains a numerical value
27  */

28 public class Formula extends FormulaRecord implements WritableCell
29 {
30   /**
31    * Constructs the formula
32    *
33    * @param c the column
34    * @param r the row
35    * @param form the formula
36    */

37   public Formula(int c, int r, String JavaDoc form)
38   {
39     super(c, r, form);
40   }
41
42   /**
43    * Constructs a formula
44    *
45    * @param c the column
46    * @param r the row
47    * @param form the formula
48    * @param st the cell style
49    */

50   public Formula(int c, int r, String JavaDoc form, CellFormat st)
51   {
52     super(c, r, form, st);
53   }
54
55   /**
56    * Copy constructor
57    *
58    * @param c the column
59    * @param r the row
60    * @param f the record to copy
61    */

62   protected Formula(int c, int r, Formula f)
63   {
64     super(c, r, f);
65   }
66   /**
67    * Implementation of the deep copy function
68    *
69    * @param col the column which the new cell will occupy
70    * @param row the row which the new cell will occupy
71    * @return a copy of this cell, which can then be added to the sheet
72    */

73   public WritableCell copyTo(int col, int row)
74   {
75     return new Formula(col, row, this);
76   }
77 }
78
Popular Tags