FileDocCategorySizeDatePackage
CalcModeRecord.javaAPI DocApache Poi 3.0.14194Mon Jan 01 12:39:40 GMT 2007org.apache.poi.hssf.record

CalcModeRecord

public class CalcModeRecord extends Record
Title: Calc Mode Record

Description: Tells the gui whether to calculate formulas automatically, manually or automatically except for tables.

REFERENCE: PG 292 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)

author
Andrew C. Oliver (acoliver at apache dot org)
author
Jason Height (jheight at chariot dot net dot au)
version
2.0-pre
see
org.apache.poi.hssf.record.CalcCountRecord

Fields Summary
public static final short
sid
public static final short
MANUAL
manually calculate formulas (0)
public static final short
AUTOMATIC
automatically calculate formulas (1)
public static final short
AUTOMATIC_EXCEPT_TABLES
automatically calculate formulas except for tables (-1)
private short
field_1_calcmode
Constructors Summary
public CalcModeRecord()


     
    
    
public CalcModeRecord(RecordInputStream in)
Constructs a CalcModeRecord and sets its fields appropriately

param
id id must be 0xD or an exception will be throw upon validation
param
size the size of the data area of the record
param
data data of the record (should not contain sid/len)

        super(in);
    
Methods Summary
public java.lang.Objectclone()

      CalcModeRecord rec = new CalcModeRecord();
      rec.field_1_calcmode = field_1_calcmode;
      return rec;
    
protected voidfillFields(org.apache.poi.hssf.record.RecordInputStream in)

        field_1_calcmode = in.readShort();
    
public shortgetCalcMode()
get the calc mode flag for formulas

see
#MANUAL
see
#AUTOMATIC
see
#AUTOMATIC_EXCEPT_TABLES
return
calcmode one of the three flags above

        return field_1_calcmode;
    
public intgetRecordSize()

        return 6;
    
public shortgetSid()

        return sid;
    
public intserialize(int offset, byte[] data)

        LittleEndian.putShort(data, 0 + offset, sid);
        LittleEndian.putShort(data, 2 + offset, ( short ) 0x2);
        LittleEndian.putShort(data, 4 + offset, getCalcMode());
        return getRecordSize();
    
public voidsetCalcMode(short calcmode)
set the calc mode flag for formulas

see
#MANUAL
see
#AUTOMATIC
see
#AUTOMATIC_EXCEPT_TABLES
param
calcmode one of the three flags above

        field_1_calcmode = calcmode;
    
public java.lang.StringtoString()

        StringBuffer buffer = new StringBuffer();

        buffer.append("[CALCMODE]\n");
        buffer.append("    .calcmode       = ")
            .append(Integer.toHexString(getCalcMode())).append("\n");
        buffer.append("[/CALCMODE]\n");
        return buffer.toString();
    
protected voidvalidateSid(short id)

        if (id != sid)
        {
            throw new RecordFormatException("NOT An Calc Mode RECORD");
        }