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

LinkedDataRecord

public class LinkedDataRecord extends Record
Describes a linked data record. This record referes to the series data or text. NOTE: This source is automatically generated please do not modify this file. Either subclass or remove the record in src/records/definitions.
author
Glen Stampoultzis (glens at apache.org)

Fields Summary
public static final short
sid
private byte
field_1_linkType
public static final byte
LINK_TYPE_TITLE_OR_TEXT
public static final byte
LINK_TYPE_VALUES
public static final byte
LINK_TYPE_CATEGORIES
private byte
field_2_referenceType
public static final byte
REFERENCE_TYPE_DEFAULT_CATEGORIES
public static final byte
REFERENCE_TYPE_DIRECT
public static final byte
REFERENCE_TYPE_WORKSHEET
public static final byte
REFERENCE_TYPE_NOT_USED
public static final byte
REFERENCE_TYPE_ERROR_REPORTED
private short
field_3_options
private BitField
customNumberFormat
private short
field_4_indexNumberFmtRecord
private LinkedDataFormulaField
field_5_formulaOfLink
Constructors Summary
public LinkedDataRecord()



     
    

    
public LinkedDataRecord(RecordInputStream in)
Constructs a LinkedData record and sets its fields appropriately.

param
id id must be 0x1051 or an exception will be throw upon validation
param
size 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()

        LinkedDataRecord rec = new LinkedDataRecord();
    
        rec.field_1_linkType = field_1_linkType;
        rec.field_2_referenceType = field_2_referenceType;
        rec.field_3_options = field_3_options;
        rec.field_4_indexNumberFmtRecord = field_4_indexNumberFmtRecord;
        rec.field_5_formulaOfLink = ((org.apache.poi.hssf.record.LinkedDataFormulaField)field_5_formulaOfLink.clone());;
        return rec;
    
protected voidfillFields(org.apache.poi.hssf.record.RecordInputStream in)

        field_1_linkType               = in.readByte();
        field_2_referenceType          = in.readByte();
        field_3_options                = in.readShort();
        field_4_indexNumberFmtRecord   = in.readShort();
        field_5_formulaOfLink = new org.apache.poi.hssf.record.LinkedDataFormulaField();
        field_5_formulaOfLink.fillField(in);
    
public LinkedDataFormulaFieldgetFormulaOfLink()
Get the formula of link field for the LinkedData record.

        return field_5_formulaOfLink;
    
public shortgetIndexNumberFmtRecord()
Get the index number fmt record field for the LinkedData record.

        return field_4_indexNumberFmtRecord;
    
public bytegetLinkType()
Get the link type field for the LinkedData record.

return
One of LINK_TYPE_TITLE_OR_TEXT LINK_TYPE_VALUES LINK_TYPE_CATEGORIES

        return field_1_linkType;
    
public shortgetOptions()
Get the options field for the LinkedData record.

        return field_3_options;
    
public intgetRecordSize()
Size of record (exluding 4 byte header)

        return 4  + 1 + 1 + 2 + 2 + field_5_formulaOfLink.getSize();
    
public bytegetReferenceType()
Get the reference type field for the LinkedData record.

return
One of REFERENCE_TYPE_DEFAULT_CATEGORIES REFERENCE_TYPE_DIRECT REFERENCE_TYPE_WORKSHEET REFERENCE_TYPE_NOT_USED REFERENCE_TYPE_ERROR_REPORTED

        return field_2_referenceType;
    
public shortgetSid()

        return sid;
    
public booleanisCustomNumberFormat()
true if this object has a custom number format

return
the custom number format field value.

        return customNumberFormat.isSet(field_3_options);
    
public intserialize(int offset, byte[] data)

        int pos = 0;

        LittleEndian.putShort(data, 0 + offset, sid);
        LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));

        data[ 4 + offset + pos ] = field_1_linkType;
        data[ 5 + offset + pos ] = field_2_referenceType;
        LittleEndian.putShort(data, 6 + offset + pos, field_3_options);
        LittleEndian.putShort(data, 8 + offset + pos, field_4_indexNumberFmtRecord);
        pos += field_5_formulaOfLink.serializeField( pos + 10 + offset, data );

        return getRecordSize();
    
public voidsetCustomNumberFormat(boolean value)
Sets the custom number format field value. true if this object has a custom number format

        field_3_options = customNumberFormat.setShortBoolean(field_3_options, value);
    
public voidsetFormulaOfLink(LinkedDataFormulaField field_5_formulaOfLink)
Set the formula of link field for the LinkedData record.

        this.field_5_formulaOfLink = field_5_formulaOfLink;
    
public voidsetIndexNumberFmtRecord(short field_4_indexNumberFmtRecord)
Set the index number fmt record field for the LinkedData record.

        this.field_4_indexNumberFmtRecord = field_4_indexNumberFmtRecord;
    
public voidsetLinkType(byte field_1_linkType)
Set the link type field for the LinkedData record.

param
field_1_linkType One of LINK_TYPE_TITLE_OR_TEXT LINK_TYPE_VALUES LINK_TYPE_CATEGORIES

        this.field_1_linkType = field_1_linkType;
    
public voidsetOptions(short field_3_options)
Set the options field for the LinkedData record.

        this.field_3_options = field_3_options;
    
public voidsetReferenceType(byte field_2_referenceType)
Set the reference type field for the LinkedData record.

param
field_2_referenceType One of REFERENCE_TYPE_DEFAULT_CATEGORIES REFERENCE_TYPE_DIRECT REFERENCE_TYPE_WORKSHEET REFERENCE_TYPE_NOT_USED REFERENCE_TYPE_ERROR_REPORTED

        this.field_2_referenceType = field_2_referenceType;
    
public java.lang.StringtoString()

        StringBuffer buffer = new StringBuffer();

        buffer.append("[AI]\n");
        buffer.append("    .linkType             = ")
            .append("0x").append(HexDump.toHex(  getLinkType ()))
            .append(" (").append( getLinkType() ).append(" )");
        buffer.append(System.getProperty("line.separator")); 
        buffer.append("    .referenceType        = ")
            .append("0x").append(HexDump.toHex(  getReferenceType ()))
            .append(" (").append( getReferenceType() ).append(" )");
        buffer.append(System.getProperty("line.separator")); 
        buffer.append("    .options              = ")
            .append("0x").append(HexDump.toHex(  getOptions ()))
            .append(" (").append( getOptions() ).append(" )");
        buffer.append(System.getProperty("line.separator")); 
        buffer.append("         .customNumberFormat       = ").append(isCustomNumberFormat()).append('\n"); 
        buffer.append("    .indexNumberFmtRecord = ")
            .append("0x").append(HexDump.toHex(  getIndexNumberFmtRecord ()))
            .append(" (").append( getIndexNumberFmtRecord() ).append(" )");
        buffer.append(System.getProperty("line.separator")); 
        buffer.append("    .formulaOfLink        = ")
            .append(" (").append( getFormulaOfLink() ).append(" )");
        buffer.append(System.getProperty("line.separator")); 

        buffer.append("[/AI]\n");
        return buffer.toString();
    
protected voidvalidateSid(short id)
Checks the sid matches the expected side for this record

param
id the expected sid.

        if (id != sid)
        {
            throw new RecordFormatException("Not a LinkedData record");
        }