jxl.write.biff
Class NumberRecord

java.lang.Object
  extended byjxl.biff.RecordData
      extended byjxl.biff.WritableRecordData
          extended byjxl.write.biff.CellValue
              extended byjxl.write.biff.NumberRecord
All Implemented Interfaces:
ByteData, Cell, WritableCell
Direct Known Subclasses:
Number

public abstract class NumberRecord
extends CellValue

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


Field Summary
 
Fields inherited from class jxl.biff.WritableRecordData
maxRecordLength
 
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(int c, int r, NumberRecord nr)
          Copy constructor
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
addCellFeatures, getCellFeatures, getCellFormat, getColumn, getRow, getSheet, getWritableCellFeatures, isHidden, removeComment, setCellFeatures, setCellFormat
 
Methods inherited from class jxl.biff.WritableRecordData
getBytes
 
Methods inherited from class jxl.biff.RecordData
getCode, getRecord
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jxl.write.WritableCell
copyTo
 

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

NumberRecord

protected NumberRecord(int c,
                       int r,
                       NumberRecord nr)
Copy constructor

Parameters:
c - the column
r - the row
nr - the record 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