jxl.read.biff
Class DateRecord

java.lang.Object
  |
  +--jxl.read.biff.DateRecord
All Implemented Interfaces:
Cell, DateCell
Direct Known Subclasses:
DateFormulaRecord

class DateRecord
extends java.lang.Object
implements DateCell

A date which is stored in the cell


Field Summary
private  CellFormat cellFormat
          The raw cell format
private  int column
          The column number of this cell record
private  java.util.Date date
          The date represented within this cell
private static java.text.SimpleDateFormat dateFormat
           
private  java.text.DateFormat format
          The format to use when displaying this cell's contents as a string
private  FormattingRecords formattingRecords
          A handle to the formatting records
private static java.util.TimeZone gmtZone
           
private  boolean initialized
          A flag to indicate whether this objects formatting things have been initialized
private static long msInADay
           
private static int nonLeapDay
           
private  int row
          The row number of this cell record
private  SheetImpl sheet
          A handle to the sheet
private  boolean time
          Indicates whether this is a full date, or merely a time
private static java.text.SimpleDateFormat timeFormat
           
private static int utcOffsetDays
           
private static int utcOffsetDays1904
           
private  int xfIndex
          The index to the XF Record
 
Constructor Summary
DateRecord(NumberCell num, int xfi, FormattingRecords fr, boolean nf, SheetImpl si)
          Constructs this object from the raw data
 
Method Summary
 CellFormat getCellFormat()
          Gets the CellFormat object for this cell.
 int getColumn()
          Interface method which returns the column number of this cell
 java.lang.String getContents()
          Gets the cell contents as a string.
 java.util.Date getDate()
          Gets the date
 java.text.DateFormat getDateFormat()
          Gets the DateFormat used to format the cell.
 int getRow()
          Interface method which returns the row number of this cell
protected  SheetImpl getSheet()
          Accessor for the sheet
 CellType getType()
          Accessor for the cell type
 boolean isHidden()
          Determines whether or not this cell has been hidden
 boolean isTime()
          Indicates whether the date value contained in this cell refers to a date, or merely a time
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

date

private java.util.Date date
The date represented within this cell

row

private int row
The row number of this cell record

column

private int column
The column number of this cell record

time

private boolean time
Indicates whether this is a full date, or merely a time

format

private java.text.DateFormat format
The format to use when displaying this cell's contents as a string

cellFormat

private CellFormat cellFormat
The raw cell format

xfIndex

private int xfIndex
The index to the XF Record

formattingRecords

private FormattingRecords formattingRecords
A handle to the formatting records

sheet

private SheetImpl sheet
A handle to the sheet

initialized

private boolean initialized
A flag to indicate whether this objects formatting things have been initialized

dateFormat

private static final java.text.SimpleDateFormat dateFormat

timeFormat

private static final java.text.SimpleDateFormat timeFormat

nonLeapDay

private static final int nonLeapDay

gmtZone

private static final java.util.TimeZone gmtZone

utcOffsetDays

private static final int utcOffsetDays

utcOffsetDays1904

private static final int utcOffsetDays1904

msInADay

private static final long msInADay
Constructor Detail

DateRecord

public DateRecord(NumberCell num,
                  int xfi,
                  FormattingRecords fr,
                  boolean nf,
                  SheetImpl si)
Constructs this object from the raw data
Parameters:
num - the numerical representation of this
xfi - the java equivalent of the excel date format
fr - the formatting records
nf - flag indicating whether we are using the 1904 date system
si - the sheet
Method Detail

getRow

public final int getRow()
Interface method which returns the row number of this cell
Specified by:
getRow in interface Cell
Returns:
the zero base row number

getColumn

public final int getColumn()
Interface method which returns the column number of this cell
Specified by:
getColumn in interface Cell
Returns:
the zero based column number

getDate

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

getContents

public java.lang.String getContents()
Gets the cell contents as a string. This method will use the java equivalent of the excel formatting string
Specified by:
getContents in interface Cell
Returns:
the label

getType

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

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

getCellFormat

public CellFormat getCellFormat()
Gets the CellFormat object for this cell. Used by the WritableWorkbook API
Specified by:
getCellFormat in interface Cell
Returns:
the CellFormat used for this cell

isHidden

public boolean isHidden()
Determines whether or not this cell has been hidden
Specified by:
isHidden in interface Cell
Returns:
TRUE if this cell has been hidden, FALSE otherwise

getSheet

protected final SheetImpl getSheet()
Accessor for the sheet