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

ExternSheetSubRecord

public class ExternSheetSubRecord extends Record
Title: A sub Record for Extern Sheet

Description: Defines a named range within a workbook.

REFERENCE:

author
Libin Roman (Vista Portal LDT. Developer)
version
1.0-pre

Fields Summary
public static final short
sid
private short
field_1_index_to_supbook
private short
field_2_index_to_first_supbook_sheet
private short
field_3_index_to_last_supbook_sheet
Constructors Summary
public ExternSheetSubRecord()
a Constractor for making new sub record

    
    
                
      
    
public ExternSheetSubRecord(RecordInputStream in)
Constructs a Extern Sheet Sub Record record and sets its fields appropriately.

param
id id must be 0x18 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)

        field_1_index_to_supbook             = in.readShort();
        field_2_index_to_first_supbook_sheet = in.readShort();
        field_3_index_to_last_supbook_sheet  = in.readShort();
    
public shortgetIndexToFirstSupBook()
gets the index to first sheet from supbook

return
index to first supbook

        return field_2_index_to_first_supbook_sheet;
    
public shortgetIndexToLastSupBook()
gets the index to last sheet in supbook

return
index to last supbook

        return field_3_index_to_last_supbook_sheet;
    
public shortgetIndexToSupBook()
gets the index to sup book

return
sup book index

        return field_1_index_to_supbook;
    
public intgetRecordSize()
returns the record size

        return 6;
    
public shortgetSid()
return the non static version of the id for this record.

        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, getIndexToSupBook());
        LittleEndian.putShort(data, 2 + offset, getIndexToFirstSupBook());
        LittleEndian.putShort(data, 4 + offset, getIndexToLastSupBook());
        
        return getRecordSize();
    
public voidsetIndexToFirstSupBook(short index)
sets the index to first sheet in supbook

param
index index to first sheet

        field_2_index_to_first_supbook_sheet = index;
    
public voidsetIndexToLastSupBook(short index)
sets the index to last sheet in supbook

param
index index to last sheet

        field_3_index_to_last_supbook_sheet = index;
    
public voidsetIndexToSupBook(short index)
Sets the Index to the sup book

param
index sup book index

        field_1_index_to_supbook = index;
    
public java.lang.StringtoString()

        StringBuffer buffer = new StringBuffer();
        buffer.append("   supbookindex =").append(getIndexToSupBook()).append('\n");
        buffer.append("   1stsbindex   =").append(getIndexToFirstSupBook()).append('\n");
        buffer.append("   lastsbindex  =").append(getIndexToLastSupBook()).append('\n");
        return buffer.toString();
    
protected voidvalidateSid(short id)
called by constructor, should throw runtime exception in the event of a record passed with a differing ID.

param
id alleged id for this record

        // do nothing