KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jxl > biff > EmptyCell


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.CellType;
23 import jxl.CellFeatures;
24 import jxl.format.CellFormat;
25 import jxl.format.Alignment;
26 import jxl.write.WritableCell;
27 import jxl.write.VerticalAlignment;
28 import jxl.write.Border;
29 import jxl.write.BorderLineStyle;
30 import jxl.write.WritableCellFeatures;
31
32 /**
33  * An empty cell. Represents an empty, as opposed to a blank cell
34  * in the workbook
35  */

36 public class EmptyCell implements WritableCell
37 {
38   /**
39    * The row of this empty cell
40    */

41   private int row;
42   /**
43    * The column number of this empty cell
44    */

45   private int col;
46
47   /**
48    * Constructs an empty cell at the specified position
49    *
50    * @param c the zero based column
51    * @param r the zero based row
52    */

53   public EmptyCell(int c, int r)
54   {
55     row = r;
56     col = c;
57   }
58
59   /**
60    * Returns the row number of this cell
61    *
62    * @return the row number of this cell
63    */

64   public int getRow()
65   {
66     return row;
67   }
68
69   /**
70    * Returns the column number of this cell
71    *
72    * @return the column number of this cell
73    */

74   public int getColumn()
75   {
76     return col;
77   }
78
79   /**
80    * Returns the content type of this cell
81    *
82    * @return the content type for this cell
83    */

84   public CellType getType()
85   {
86     return CellType.EMPTY;
87   }
88
89   /**
90    * Quick and dirty function to return the contents of this cell as a string.
91    *
92    * @return an empty string
93    */

94   public String JavaDoc getContents()
95   {
96     return "";
97   }
98
99   /**
100    * Accessor for the format which is applied to this cell
101    *
102    * @return the format applied to this cell
103    */

104   public CellFormat getCellFormat()
105   {
106     return null;
107   }
108
109   /**
110    * Dummy override
111    * @param flag the hidden flag
112    */

113   public void setHidden(boolean flag)
114   {
115   }
116
117   /**
118    * Dummy override
119    * @param flag dummy
120    */

121   public void setLocked(boolean flag)
122   {
123   }
124
125   /**
126    * Dummy override
127    * @param align dummy
128    */

129   public void setAlignment(Alignment align)
130   {
131   }
132
133   /**
134    * Dummy override
135    * @param valign dummy
136    */

137   public void setVerticalAlignment(VerticalAlignment valign)
138   {
139   }
140
141   /**
142    * Dummy override
143    * @param line dummy
144    * @param border dummy
145    */

146   public void setBorder(Border border, BorderLineStyle line)
147   {
148   }
149
150   /**
151    * Dummy override
152    * @param cf dummy
153    */

154   public void setCellFormat(CellFormat cf)
155   {
156   }
157
158   /**
159    * Dummy override
160    * @param cf dummy
161    * @deprecated
162    */

163   public void setCellFormat(jxl.CellFormat cf)
164   {
165   }
166
167   /**
168    * Indicates whether or not this cell is hidden, by virtue of either
169    * the entire row or column being collapsed
170    *
171    * @return TRUE if this cell is hidden, FALSE otherwise
172    */

173   public boolean isHidden()
174   {
175     return false;
176   }
177
178   /**
179    * Implementation of the deep copy function
180    *
181    * @param c the column which the new cell will occupy
182    * @param r the row which the new cell will occupy
183    * @return a copy of this cell, which can then be added to the sheet
184    */

185   public WritableCell copyTo(int c, int r)
186   {
187     return new EmptyCell(c, r);
188   }
189
190   /**
191    * Accessor for the cell features
192    *
193    * @return the cell features or NULL if this cell doesn't have any
194    */

195   public CellFeatures getCellFeatures()
196   {
197     return null;
198   }
199
200   /**
201    * Accessor for the cell features
202    *
203    * @return the cell features or NULL if this cell doesn't have any
204    */

205   public WritableCellFeatures getWritableCellFeatures()
206   {
207     return null;
208   }
209
210   /**
211    * Accessor for the cell features
212    */

213   public void setCellFeatures(WritableCellFeatures wcf)
214   {
215   }
216
217 }
218
219
220
Popular Tags