jxl.read.biff
Class SharedNumberFormulaRecord

java.lang.Object
  |
  +--jxl.biff.RecordData
        |
        +--jxl.read.biff.CellValue
              |
              +--jxl.read.biff.BaseSharedFormulaRecord
                    |
                    +--jxl.read.biff.SharedNumberFormulaRecord
All Implemented Interfaces:
Cell, FormulaCell, FormulaData, NumberCell, NumberFormulaCell

public class SharedNumberFormulaRecord
extends BaseSharedFormulaRecord
implements NumberCell, FormulaData, NumberFormulaCell

A number formula record, manufactured out of the Shared Formula "optimization"


Field Summary
private static java.text.DecimalFormat defaultFormat
          The string format for the double value
private  java.text.NumberFormat format
          The cell format
private  FormattingRecords formattingRecords
          A handle to the formatting records
private  double value
          The value of this number
 
Fields inherited from class jxl.read.biff.BaseSharedFormulaRecord
externalSheet, formulaString, nameTable, tokens
 
Fields inherited from class jxl.read.biff.CellValue
column, initialized, row, sheet, xfIndex
 
Fields inherited from class jxl.biff.RecordData
code, record
 
Constructor Summary
SharedNumberFormulaRecord(Record t, double v, FormattingRecords fr, ExternalSheet es, NameTable nt, SheetImpl si)
          Constructs this number
 
Method Summary
 java.lang.String getContents()
          Accessor for the contents as a string
 byte[] getFormulaData()
          Gets the raw bytes for the formula.
 java.text.NumberFormat getNumberFormat()
          Gets the NumberFormat used to format this cell.
 CellType getType()
          Accessor for the cell type
 double getValue()
          Accessor for the value
(package private)  void setNumberFormat(java.text.NumberFormat f)
          Sets the format for the number based on the Excel spreadsheets' format.
 
Methods inherited from class jxl.read.biff.BaseSharedFormulaRecord
getExternalSheet, getFormula, getNameTable, getRecord, getTokens, setTokens
 
Methods inherited from class jxl.read.biff.CellValue
getCellFormat, getColumn, getRow, getSheet, getXFIndex, isHidden
 
Methods inherited from class jxl.biff.RecordData
getCode
 
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
 
Methods inherited from interface jxl.FormulaCell
getFormula
 

Field Detail

value

private double value
The value of this number

format

private java.text.NumberFormat format
The cell format

formattingRecords

private FormattingRecords formattingRecords
A handle to the formatting records

defaultFormat

private static java.text.DecimalFormat defaultFormat
The string format for the double value
Constructor Detail

SharedNumberFormulaRecord

public SharedNumberFormulaRecord(Record t,
                                 double v,
                                 FormattingRecords fr,
                                 ExternalSheet es,
                                 NameTable nt,
                                 SheetImpl si)
Constructs this number
Parameters:
t - the data
v - the value
fr - the formatting records
es - the external sheet
nt - the name table
si - the sheet
Method Detail

setNumberFormat

final void setNumberFormat(java.text.NumberFormat f)
Sets the format for the number based on the Excel spreadsheets' format. This is called from SheetImpl when it has been definitely established that this cell is a number and not a date
Parameters:
f - the format

getValue

public double getValue()
Accessor for the value
Specified by:
getValue in interface NumberCell
Returns:
the value

getContents

public java.lang.String getContents()
Accessor for the contents as a string
Specified by:
getContents in interface Cell
Returns:
the value as a string

getType

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

getFormulaData

public byte[] getFormulaData()
                      throws FormulaException
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

getNumberFormat

public java.text.NumberFormat getNumberFormat()
Gets the NumberFormat used to format this cell. This is the java equivalent of the Excel format
Specified by:
getNumberFormat in interface NumberCell
Returns:
the NumberFormat used to format the cell