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

RefModeRecord

public class RefModeRecord extends Record
Title: RefMode Record

Description: Describes which reference mode to use

REFERENCE: PG 376 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

Fields Summary
public static final short
sid
public static final short
USE_A1_MODE
public static final short
USE_R1C1_MODE
private short
field_1_mode
Constructors Summary
public RefModeRecord()


     
    
    
public RefModeRecord(RecordInputStream in)
Constructs a RefMode record and sets its fields appropriately.

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

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

        field_1_mode = in.readShort();
    
public shortgetMode()
get the reference mode to use (HSSF uses/assumes A1)

return
mode to use
see
#USE_A1_MODE
see
#USE_R1C1_MODE

        return field_1_mode;
    
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, getMode());
        return getRecordSize();
    
public voidsetMode(short mode)
set the reference mode to use (HSSF uses/assumes A1)

param
mode the mode to use
see
#USE_A1_MODE
see
#USE_R1C1_MODE

        field_1_mode = mode;
    
public java.lang.StringtoString()

        StringBuffer buffer = new StringBuffer();

        buffer.append("[REFMODE]\n");
        buffer.append("    .mode           = ")
            .append(Integer.toHexString(getMode())).append("\n");
        buffer.append("[/REFMODE]\n");
        return buffer.toString();
    
protected voidvalidateSid(short id)

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