jxl.read.biff
Class SharedDateFormulaRecord

java.lang.Object
  extended byjxl.biff.RecordData
      extended byjxl.read.biff.CellValue
          extended byjxl.read.biff.BaseSharedFormulaRecord
              extended byjxl.read.biff.SharedDateFormulaRecord
All Implemented Interfaces:
Cell, jxl.read.biff.CellFeaturesAccessor, DateCell, DateFormulaCell, FormulaCell, FormulaData

public class SharedDateFormulaRecord
extends BaseSharedFormulaRecord
implements DateCell, FormulaData, DateFormulaCell

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


Constructor Summary
SharedDateFormulaRecord(SharedNumberFormulaRecord nfr, FormattingRecords fr, boolean nf, SheetImpl si, int pos)
          Constructs this number formula
 
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
 
Methods inherited from class jxl.read.biff.CellValue
getCellFeatures, getCellFormat, getColumn, getRow, getSheet, getXFIndex, isHidden, setCellFeatures
 
Methods inherited from class jxl.biff.RecordData
getCode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jxl.Cell
getCellFeatures, getCellFormat, getColumn, getRow, isHidden
 
Methods inherited from interface jxl.FormulaCell
getFormula
 

Constructor Detail

SharedDateFormulaRecord

public SharedDateFormulaRecord(SharedNumberFormulaRecord nfr,
                               FormattingRecords fr,
                               boolean nf,
                               SheetImpl si,
                               int pos)
Constructs this number formula

Parameters:
nfr - the number formula records
fr - the formatting records
nf - flag indicating whether this uses the 1904 date system
si - the sheet
pos - the position
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
Throws:
FormulaException

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