FileDocCategorySizeDatePackage
NumberPtg.javaAPI DocApache Poi 3.0.12778Mon Jan 01 12:39:40 GMT 2007org.apache.poi.hssf.record.formula

NumberPtg

public class NumberPtg extends Ptg
Number Stores a floating point value in a formula value stored in a 8 byte field using IEEE notation
author
Avik Sengupta
author
Jason Height (jheight at chariot dot net dot au)

Fields Summary
public static final int
SIZE
public static final byte
sid
private double
field_1_value
Constructors Summary
private NumberPtg()


      
      //Required for clone methods
    
public NumberPtg(RecordInputStream in)
Create a NumberPtg from a byte array read from disk

        setValue(in.readDouble());
    
public NumberPtg(String value)
Create a NumberPtg from a string representation of the number Number format is not checked, it is expected to be validated in the parser that calls this method.

param
value : String representation of a floating point number

        setValue(Double.parseDouble(value));
    
Methods Summary
public java.lang.Objectclone()

      NumberPtg ptg = new NumberPtg();
      ptg.field_1_value = field_1_value;
      return ptg;
    
public bytegetDefaultOperandClass()

return Ptg.CLASS_VALUE;
public intgetSize()

        return SIZE;
    
public doublegetValue()

        return field_1_value;
    
public voidsetValue(double value)

        field_1_value = value;
    
public java.lang.StringtoFormulaString(org.apache.poi.hssf.model.Workbook book)

        return "" + getValue();
    
public voidwriteBytes(byte[] array, int offset)

        array[ offset + 0 ] = sid;
        LittleEndian.putDouble(array, offset + 1, getValue());