jxl.read.biff
Class SharedDateFormulaRecord

java.lang.Object
  |
  +--jxl.biff.RecordData
        |
        +--jxl.read.biff.CellValue
              |
              +--jxl.read.biff.BaseSharedFormulaRecord
                    |
                    +--jxl.read.biff.SharedDateFormulaRecord
All Implemented Interfaces:
Cell, DateCell, FormulaData

public class SharedDateFormulaRecord
extends BaseSharedFormulaRecord
implements DateCell, FormulaData

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


Field Summary
private  DateRecord dateRecord
          Re-use the date record to handle all the formatting information and date calculations
private  double value
          The double value
 
Fields inherited from class jxl.read.biff.BaseSharedFormulaRecord
externalSheet, formattingRecords, formulaString, nameTable, tokens
 
Fields inherited from class jxl.read.biff.CellValue
column, format, initialized, row, sheet, xfIndex
 
Fields inherited from class jxl.biff.RecordData
code, record
 
Constructor Summary
SharedDateFormulaRecord(SharedNumberFormulaRecord nfr, FormattingRecords fr, boolean nf, SheetImpl si)
          Constructs this number
 
Method Summary
 java.lang.String getContents()
          Accessor for the contents as a string
 java.util.Date getDate()
          Gets the date
 java.text.DateFormat getDateFormat()
          Gets the DateFormat used to format the cell.
 byte[] getFormulaData()
          Gets the raw bytes for the formula.
 CellType getType()
          Accessor for the cell type
 double getValue()
          Accessor for the value
 boolean isTime()
          Indicates whether the date value contained in this cell refers to a date, or merely a time
 
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
 

Field Detail

dateRecord

private DateRecord dateRecord
Re-use the date record to handle all the formatting information and date calculations

value

private double value
The double value
Constructor Detail

SharedDateFormulaRecord

public SharedDateFormulaRecord(SharedNumberFormulaRecord nfr,
                               FormattingRecords fr,
                               boolean nf,
                               SheetImpl si)
Constructs this number
Parameters:
f - the formula
r - the zero based row
val - the value
nf - flag indicating whether this uses the 1904 date system
si - the sheet
Method Detail

getValue

public double getValue()
Accessor for the value
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

getDate

public java.util.Date getDate()
Gets the date
Specified by:
getDate in interface DateCell
Returns:
the date

isTime

public boolean isTime()
Indicates whether the date value contained in this cell refers to a date, or merely a time
Specified by:
isTime in interface DateCell
Returns:
TRUE if the value refers to a time

getDateFormat

public java.text.DateFormat getDateFormat()
Gets the DateFormat used to format the cell. This will normally be the format specified in the excel spreadsheet, but in the event of any difficulty parsing this, it will revert to the default date/time format.
Specified by:
getDateFormat in interface DateCell
Returns:
the DateFormat object used to format the date in the original excel cell