KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jxl > write > Boolean


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.BooleanCell;
23 import jxl.format.CellFormat;
24 import jxl.write.biff.BooleanRecord;
25
26 /**
27  * A cell, created by user applications, which contains a boolean (or
28  * in some cases an error) value
29  */

30 public class Boolean extends BooleanRecord implements WritableCell, BooleanCell
31 {
32   /**
33    * Constructs a boolean value, which, when added to a spreadsheet, will
34    * display the specified value at the column/row position indicated.
35    *
36    * @param c the column
37    * @param r the row
38    * @param val the value
39    */

40   public Boolean(int c, int r, boolean val)
41   {
42     super(c, r, val);
43   }
44
45   /**
46    * Constructs a boolean, which, when added to a spreadsheet, will display the
47    * specified value at the column/row position with the specified CellFormat.
48    * The CellFormat may specify font information
49    *
50    * @param c the column
51    * @param r the row
52    * @param val the value
53    * @param st the cell format
54    */

55   public Boolean(int c, int r, boolean val, CellFormat st)
56   {
57     super(c, r, val, st);
58   }
59
60   /**
61    * Constructor used internally by the application when making a writable
62    * copy of a spreadsheet that has been read in
63    *
64    * @param nc the cell to copy
65    */

66   public Boolean(BooleanCell nc)
67   {
68     super(nc);
69   }
70
71   /**
72    * Copy constructor used for deep copying
73    *
74    * @param col the column
75    * @param row the row
76    * @param b the cell to copy
77    */

78   protected Boolean(int col, int row, Boolean JavaDoc b)
79   {
80     super(col, row, b);
81   }
82   /**
83    * Sets the boolean value for this cell
84    *
85    * @param val the value
86    */

87   public void setValue(boolean val)
88   {
89     super.setValue(val);
90   }
91
92   /**
93    * Implementation of the deep copy function
94    *
95    * @param col the column which the new cell will occupy
96    * @param row the row which the new cell will occupy
97    * @return a copy of this cell, which can then be added to the sheet
98    */

99   public WritableCell copyTo(int col, int row)
100   {
101     return new Boolean JavaDoc(col, row, this);
102   }
103 }
104
Popular Tags