jxl.write.biff
Class CellValue

java.lang.Object
  extended byjxl.biff.RecordData
      extended byjxl.biff.WritableRecordData
          extended byjxl.write.biff.CellValue
All Implemented Interfaces:
ByteData, Cell, WritableCell
Direct Known Subclasses:
BlankRecord, BooleanRecord, DateRecord, FormulaRecord, LabelRecord, NumberRecord

public abstract class CellValue
extends WritableRecordData
implements WritableCell

Abstract class which stores the common data used for cells, such as row, column and formatting information. Any record which directly represents the contents of a cell, such as labels and numbers, are derived from this class data store


Field Summary
 
Fields inherited from class jxl.biff.WritableRecordData
maxRecordLength
 
Constructor Summary
protected CellValue(Type t, Cell c)
          Constructor used when creating a writable cell from a read-only cell (when copying a workbook)
protected CellValue(Type t, int c, int r)
          Constructor used when building writable cells from the Java API
protected CellValue(Type t, int c, int r, CellFormat st)
          Overloaded constructor used when building writable cells from the Java API which also takes a format
protected CellValue(Type t, int c, int r, CellValue cv)
          Copy constructor
 
Method Summary
 void addCellFeatures()
          Handles any addition cell features, such as comments or data validation.
 CellFeatures getCellFeatures()
          Accessor for the cell features
 CellFormat getCellFormat()
          API method which gets the format applied to this cell
 int getColumn()
          Returns the column number of this cell
 byte[] getData()
          Gets the data to write to the output file
 int getRow()
          Returns the row number of this cell
protected  jxl.write.biff.WritableSheetImpl getSheet()
          Accessor for the sheet containing this cell
 WritableCellFeatures getWritableCellFeatures()
          Accessor for the cell features
 boolean isHidden()
          Indicates whether or not this cell is hidden, by virtue of either the entire row or column being collapsed
 void removeComment(Comment c)
          Called by the cell features to remove a comment
 void setCellFeatures(WritableCellFeatures cf)
          Sets the cell features
 void setCellFormat(CellFormat cf)
          An API function which sets the format to apply to this cell
 
Methods inherited from class jxl.biff.WritableRecordData
getBytes
 
Methods inherited from class jxl.biff.RecordData
getCode, getRecord
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jxl.write.WritableCell
copyTo
 
Methods inherited from interface jxl.Cell
getContents, getType
 

Constructor Detail

CellValue

protected CellValue(Type t,
                    int c,
                    int r)
Constructor used when building writable cells from the Java API

Parameters:
c - the column
t - the type indicator
r - the row

CellValue

protected CellValue(Type t,
                    Cell c)
Constructor used when creating a writable cell from a read-only cell (when copying a workbook)

Parameters:
c - the cell to clone
t - the type of this cell

CellValue

protected CellValue(Type t,
                    int c,
                    int r,
                    CellFormat st)
Overloaded constructor used when building writable cells from the Java API which also takes a format

Parameters:
c - the column
t - the cell type
r - the row
st - the format to apply to this cell

CellValue

protected CellValue(Type t,
                    int c,
                    int r,
                    CellValue cv)
Copy constructor

Parameters:
c - the column
t - the cell type
r - the row
cv - the value to copy
Method Detail

setCellFormat

public void setCellFormat(CellFormat cf)
An API function which sets the format to apply to this cell

Specified by:
setCellFormat in interface WritableCell
Parameters:
cf - the format to apply to this cell

getRow

public int getRow()
Returns the row number of this cell

Specified by:
getRow in interface Cell
Returns:
the row number of this cell

getColumn

public int getColumn()
Returns the column number of this cell

Specified by:
getColumn in interface Cell
Returns:
the column number of this cell

isHidden

public boolean isHidden()
Indicates whether or not this cell is hidden, by virtue of either the entire row or column being collapsed

Specified by:
isHidden in interface Cell
Returns:
TRUE if this cell is hidden, FALSE otherwise

getData

public byte[] getData()
Gets the data to write to the output file

Specified by:
getData in class WritableRecordData
Returns:
the binary data

getCellFormat

public CellFormat getCellFormat()
API method which gets the format applied to this cell

Specified by:
getCellFormat in interface Cell
Returns:
the format for this cell

getSheet

protected jxl.write.biff.WritableSheetImpl getSheet()
Accessor for the sheet containing this cell

Returns:
the sheet containing this cell

getCellFeatures

public CellFeatures getCellFeatures()
Accessor for the cell features

Specified by:
getCellFeatures in interface Cell
Returns:
the cell features or NULL if this cell doesn't have any

getWritableCellFeatures

public WritableCellFeatures getWritableCellFeatures()
Accessor for the cell features

Specified by:
getWritableCellFeatures in interface WritableCell
Returns:
the cell features or NULL if this cell doesn't have any

setCellFeatures

public void setCellFeatures(WritableCellFeatures cf)
Sets the cell features

Specified by:
setCellFeatures in interface WritableCell
Parameters:
cf - the cell features

addCellFeatures

public final void addCellFeatures()
Handles any addition cell features, such as comments or data validation. Called internally from this class when a cell is added to the workbook, and also externally from BaseCellFeatures following a call to setComment


removeComment

public final void removeComment(Comment c)
Called by the cell features to remove a comment

Parameters:
c - the comment to remove