jxl.write.biff
Class FormulaRecord

java.lang.Object
  |
  +--jxl.biff.RecordData
        |
        +--jxl.biff.WritableRecordData
              |
              +--jxl.write.biff.CellValue
                    |
                    +--jxl.write.biff.FormulaRecord
All Implemented Interfaces:
ByteData, Cell, FormulaData, WritableCell
Direct Known Subclasses:
Formula

public class FormulaRecord
extends CellValue
implements FormulaData

A formula record. Parses the string passed in to deduce the set of formula records


Field Summary
private  byte[] formulaBytes
          The parsed formula bytes
private  java.lang.String formulaString
          The parsed formula string
private  java.lang.String formulaToParse
          The formula to parse
private  FormulaParser parser
          The formula parser
 
Fields inherited from class jxl.write.biff.CellValue
column, format, formattingRecords, referenced, row, sheet
 
Fields inherited from class jxl.biff.RecordData
code, record
 
Constructor Summary
FormulaRecord(int c, int r, java.lang.String f)
          Constructor
FormulaRecord(int c, int r, java.lang.String f, CellFormat st)
          Constructor
 
Method Summary
 java.lang.String getContents()
          Quick and dirty function to return the contents of this cell as a string.
 byte[] getData()
          Gets the binary data for output to file
 byte[] getFormulaData()
          Gets the raw bytes for the formula.
 CellType getType()
          Returns the content type of this cell
private  void initialize(WorkbookSettings ws, ExternalSheet es)
          Initializes the string and the formula bytes.
(package private)  void setCellDetails(FormattingRecords fr, SharedStrings ss, WritableSheetImpl s)
          Called when the cell is added to the worksheet.
 
Methods inherited from class jxl.write.biff.CellValue
decrementColumn, decrementRow, getCellFormat, getColumn, getRow, getXFIndex, incrementColumn, incrementRow, isHidden, isReferenced, setCellFormat
 
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, registerNatives, toString, wait, wait, wait
 
Methods inherited from interface jxl.Cell
getCellFormat, getColumn, getRow, isHidden
 

Field Detail

formulaToParse

private java.lang.String formulaToParse
The formula to parse

parser

private FormulaParser parser
The formula parser

formulaString

private java.lang.String formulaString
The parsed formula string

formulaBytes

private byte[] formulaBytes
The parsed formula bytes
Constructor Detail

FormulaRecord

public FormulaRecord(int c,
                     int r,
                     java.lang.String f)
Constructor
Parameters:
f - the formula to copy

FormulaRecord

public FormulaRecord(int c,
                     int r,
                     java.lang.String f,
                     CellFormat st)
Constructor
Parameters:
f - the formula to copy
Method Detail

initialize

private void initialize(WorkbookSettings ws,
                        ExternalSheet es)
Initializes the string and the formula bytes. In order to get access to the workbook settings, the object is not initialized until it is added to the sheet
Parameters:
ws - the workbook settings
es - the external sheet

setCellDetails

void setCellDetails(FormattingRecords fr,
                    SharedStrings ss,
                    WritableSheetImpl s)
Called when the cell is added to the worksheet. Overrides the method in the base class in order to get a handle to the WorkbookSettings so that this formula may be initialized
Overrides:
setCellDetails in class CellValue
Parameters:
fr - the formatting records
ss - the shared strings used within the workbook
s - the sheet this is being added to

getData

public byte[] getData()
Gets the binary data for output to file
Overrides:
getData in class CellValue
Returns:
the binary data

getType

public CellType getType()
Returns the content type of this cell
Specified by:
getType in interface Cell
Returns:
the content type for this cell

getContents

public java.lang.String getContents()
Quick and dirty function to return the contents of this cell as a string. For more complex manipulation of the contents, it is necessary to cast this interface to correct subinterface
Specified by:
getContents in interface Cell
Returns:
the contents of this cell as a string

getFormulaData

public byte[] getFormulaData()
Gets the raw bytes for the formula. This will include the parsed tokens array. Used when copying spreadsheets
Specified by:
getFormulaData in interface FormulaData
Returns:
the raw record data