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

SupBookRecord

public class SupBookRecord extends Record
Title: Sup Book

Description: A Extrenal Workbook Deciption (Sup Book) Its only a dummy record for making new ExternSheet Record

REFERENCE:

author
Libin Roman (Vista Portal LDT. Developer)
author
Andrew C. Oliver (acoliver@apache.org)

Fields Summary
public static final short
sid
private short
field_1_number_of_sheets
private short
field_2_flag
Constructors Summary
public SupBookRecord()



     
    
        setFlag((short)0x401);
    
public SupBookRecord(RecordInputStream in)
Constructs a Extern Sheet record and sets its fields appropriately.

param
id id must be 0x16 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)
called by the constructor, should set class level fields. Should throw runtime exception for bad/icomplete data.

param
data raw data
param
size size of data
param
offset of the record's data (provided a big array of the file)

        //For now We use it only for one case
        //When we need to add an named range when no named ranges was
        //before it
        field_1_number_of_sheets = in.readShort();
        field_2_flag = in.readShort();
    
public shortgetFlag()

        return field_2_flag;
    
public shortgetNumberOfSheets()

        return field_1_number_of_sheets;
    
public intgetRecordSize()

        return 4 + 4;
    
public shortgetSid()

        return sid;
    
public intserialize(int offset, byte[] data)
called by the class that is responsible for writing this sucker. Subclasses should implement this so that their data is passed back in a byte array.

param
offset to begin writing at
param
data byte array containing instance data
return
number of bytes written

        LittleEndian.putShort(data, 0 + offset, sid);
        LittleEndian.putShort(data, 2 + offset, (short) 4);
        LittleEndian.putShort(data, 4 + offset, field_1_number_of_sheets);
        LittleEndian.putShort(data, 6 + offset, field_2_flag);

        return getRecordSize();
    
public voidsetFlag(short flag)

        field_2_flag = flag;
    
public voidsetNumberOfSheets(short number)

        field_1_number_of_sheets = number;
    
public java.lang.StringtoString()

        StringBuffer buffer = new StringBuffer();
        buffer.append("[SUPBOOK]\n");
        buffer.append("numberosheets = ").append(getNumberOfSheets()).append('\n");
        buffer.append("flag          = ").append(getFlag()).append('\n");
        buffer.append("[/SUPBOOK]\n");
        return buffer.toString();
    
protected voidvalidateSid(short id)

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