jxl.write.biff
Class NumberRecord

java.lang.Object
  |
  +--jxl.biff.RecordData
        |
        +--jxl.biff.WritableRecordData
              |
              +--jxl.write.biff.CellValue
                    |
                    +--jxl.write.biff.NumberRecord
All Implemented Interfaces:
ByteData, Cell, WritableCell
Direct Known Subclasses:
Number

public class NumberRecord
extends CellValue

The record which contains numerical values. All values are stored as 64bit IEEE floating point values


Field Summary
private  double value
          The number
 
Fields inherited from class jxl.write.biff.CellValue
column, format, formattingRecords, referenced, row, sheet
 
Fields inherited from class jxl.biff.WritableRecordData
maxRecordLength
 
Fields inherited from class jxl.biff.RecordData
code, record
 
Constructor Summary
protected NumberRecord(int c, int r, double val)
          Constructor invoked by the user API
protected NumberRecord(int c, int r, double val, CellFormat st)
          Overloaded constructor invoked from the API, which takes a cell format
protected NumberRecord(NumberCell nc)
          Constructor used when copying a workbook
 
Method Summary
 java.lang.String getContents()
          Quick and dirty function to return the contents of this cell as a string.
 byte[] getData()
          Gets the binary data for output to file
 java.text.NumberFormat getNumberFormat()
          Gets the NumberFormat used to format this cell.
 CellType getType()
          Returns the content type of this cell
 double getValue()
          Gets the double contents for this cell.
 void setValue(double val)
          Sets the value of the contents for this cell
 
Methods inherited from class jxl.write.biff.CellValue
decrementColumn, decrementRow, getCellFormat, getColumn, getRow, getXFIndex, incrementColumn, incrementRow, isHidden, isReferenced, setCellDetails, setCellFormat
 
Methods inherited from class jxl.biff.WritableRecordData
getBytes, handleContinueRecords
 
Methods inherited from class jxl.biff.RecordData
getCode, getRecord
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

value

private double value
The number
Constructor Detail

NumberRecord

protected NumberRecord(int c,
                       int r,
                       double val)
Constructor invoked by the user API
Parameters:
c - the column
r - the row
val - the value

NumberRecord

protected NumberRecord(int c,
                       int r,
                       double val,
                       CellFormat st)
Overloaded constructor invoked from the API, which takes a cell format
Parameters:
c - the column
r - the row
val - the value
st - the cell format

NumberRecord

protected NumberRecord(NumberCell nc)
Constructor used when copying a workbook
Parameters:
nc - the number to copy
Method Detail

getType

public CellType getType()
Returns the content type of this cell
Returns:
the content type for this cell

getData

public byte[] getData()
Gets the binary data for output to file
Overrides:
getData in class CellValue
Returns:
the binary data

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
Returns:
the contents of this cell as a string

getValue

public double getValue()
Gets the double contents for this cell.
Returns:
the cell contents

setValue

public void setValue(double val)
Sets the value of the contents for this cell
Parameters:
val - the new value

getNumberFormat

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