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

UseSelFSRecord

public class UseSelFSRecord extends Record
Title: Use Natural Language Formulas Flag

Description: Tells the GUI if this was written by something that can use "natural language" formulas. HSSF can't.

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

author
Andrew C. Oliver (acoliver at apache dot org)
version
2.0-pre

Fields Summary
public static final short
sid
public static final short
TRUE
public static final short
FALSE
private short
field_1_flag
Constructors Summary
public UseSelFSRecord()


     
    
    
public UseSelFSRecord(RecordInputStream in)
Constructs a UseSelFS record and sets its fields appropriately.

param
id id must be 0x160 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
protected voidfillFields(org.apache.poi.hssf.record.RecordInputStream in)

        field_1_flag = in.readShort();
    
public shortgetFlag()
returns whether we use natural language formulas or not

return
whether to use natural language formulas or not
see
#TRUE
see
#FALSE

        return field_1_flag;
    
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 ) 0x02));   // 2 bytes (6 total)
        LittleEndian.putShort(data, 4 + offset, getFlag());
        return getRecordSize();
    
public voidsetFlag(short flag)
turn the flag on or off

param
flag whether to use natural language formulas or not
see
#TRUE
see
#FALSE

        field_1_flag = flag;
    
public java.lang.StringtoString()

        StringBuffer buffer = new StringBuffer();

        buffer.append("[USESELFS]\n");
        buffer.append("    .flag            = ")
            .append(Integer.toHexString(getFlag())).append("\n");
        buffer.append("[/USESELFS]\n");
        return buffer.toString();
    
protected voidvalidateSid(short id)

        if (id != sid)
        {
            throw new RecordFormatException("NOT A UseSelFS RECORD");
        }