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
Methods inherited from class jxl.write.biff.CellValue |
decrementColumn, decrementRow, getCellFormat, getColumn, getRow, getXFIndex, incrementColumn, incrementRow, isHidden, isReferenced, setCellFormat |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
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
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
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 settingses
- 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 recordsss
- the shared strings used within the workbooks
- 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