FileDocCategorySizeDatePackage
FormulaRecordAggregate.javaAPI DocApache Poi 3.0.15091Mon Jan 01 12:39:40 GMT 2007org.apache.poi.hssf.record.aggregates

FormulaRecordAggregate

public class FormulaRecordAggregate extends Record implements Comparable, CellValueRecordInterface
The formula record aggregate is used to join together the formula record and it's (optional) string record and (optional) Shared Formula Record (template reads, excel optimization).
author
Glen Stampoultzis (glens at apache.org)

Fields Summary
public static final short
sid
private FormulaRecord
formulaRecord
private StringRecord
stringRecord
Constructors Summary
public FormulaRecordAggregate(FormulaRecord formulaRecord, StringRecord stringRecord)

    
          
    
        this.formulaRecord = formulaRecord;
        this.stringRecord = stringRecord;
    
Methods Summary
public java.lang.Objectclone()

see
java.lang.Object#clone()

			StringRecord clonedString = (stringRecord == null) ? null : (StringRecord)stringRecord.clone();
    		
        return new FormulaRecordAggregate((FormulaRecord) this.formulaRecord.clone(), clonedString);
    
public intcompareTo(java.lang.Object o)

        return formulaRecord.compareTo( o );
    
public booleanequals(java.lang.Object obj)

        return formulaRecord.equals( obj );
    
protected voidfillFields(org.apache.poi.hssf.record.RecordInputStream in)

    
public shortgetColumn()

        return formulaRecord.getColumn();
    
public org.apache.poi.hssf.record.FormulaRecordgetFormulaRecord()

        return formulaRecord;
    
public intgetRecordSize()
gives the current serialized size of the record. Should include the sid and reclength (4 bytes).

        int size = formulaRecord.getRecordSize() + (stringRecord == null ? 0 : stringRecord.getRecordSize());
        return size;
    
public intgetRow()

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

        return sid;
    
public org.apache.poi.hssf.record.StringRecordgetStringRecord()

        return stringRecord;
    
public java.lang.StringgetStringValue()

        if(stringRecord==null) return null;
        return stringRecord.getString();
   
public shortgetXFIndex()

        return formulaRecord.getXFIndex();
    
public booleanisAfter(org.apache.poi.hssf.record.CellValueRecordInterface i)

        return formulaRecord.isAfter( i );
    
public booleanisBefore(org.apache.poi.hssf.record.CellValueRecordInterface i)

        return formulaRecord.isBefore( i );
    
public booleanisEqual(org.apache.poi.hssf.record.CellValueRecordInterface i)

        return formulaRecord.isEqual( i );
    
public booleanisInValueSection()


      return true;
   
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

        int pos = offset;
        pos += formulaRecord.serialize(pos, data);

         if (stringRecord != null)
        {
            pos += stringRecord.serialize(pos, data);
        }
        return pos - offset;
        
    
public voidsetColumn(short col)

        formulaRecord.setColumn( col );
    
public voidsetFormulaRecord(org.apache.poi.hssf.record.FormulaRecord formulaRecord)

        this.formulaRecord = formulaRecord;
    
public voidsetRow(int row)

        formulaRecord.setRow( row );
    
public voidsetStringRecord(org.apache.poi.hssf.record.StringRecord stringRecord)

        this.stringRecord = stringRecord;
    
public voidsetXFIndex(short xf)

        formulaRecord.setXFIndex( xf );
    
public java.lang.StringtoString()

        return formulaRecord.toString();
    
protected voidvalidateSid(short id)