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; 21 22 import jxl.format.CellFormat; 23 24 /** 25 * Represents an individual Cell within a Sheet. May be queried for its 26 * type and its content 27 */ 28 public interface Cell 29 { 30 /** 31 * Returns the row number of this cell 32 * 33 * @return the row number of this cell 34 */ 35 public int getRow(); 36 37 /** 38 * Returns the column number of this cell 39 * 40 * @return the column number of this cell 41 */ 42 public int getColumn(); 43 44 /** 45 * Returns the content type of this cell 46 * 47 * @return the content type for this cell 48 */ 49 public CellType getType(); 50 51 /** 52 * Indicates whether or not this cell is hidden, by virtue of either 53 * the entire row or column being collapsed 54 * 55 * @return TRUE if this cell is hidden, FALSE otherwise 56 */ 57 public boolean isHidden(); 58 59 /** 60 * Quick and dirty function to return the contents of this cell as a string. 61 * For more complex manipulation of the contents, it is necessary to cast 62 * this interface to correct subinterface 63 * 64 * @return the contents of this cell as a string 65 */ 66 public String getContents(); 67 68 /** 69 * Gets the cell format which applies to this cell 70 * Note that for cell with a cell type of EMPTY, which has no formatting 71 * information, this method will return null. Some empty cells (eg. on 72 * template spreadsheets) may have a cell type of EMPTY, but will 73 * actually contain formatting information 74 * 75 * @return the cell format applied to this cell, or NULL if this is an 76 * empty cell 77 */ 78 public CellFormat getCellFormat(); 79 80 /** 81 * Gets any special cell features, such as comments (notes) or cell 82 * validation present for this cell 83 * 84 * @return the cell features, or NULL if this cell has no special features 85 */ 86 public CellFeatures getCellFeatures(); 87 }