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

LinkedDataFormulaField

public class LinkedDataFormulaField extends Object implements CustomField
Not implemented yet. May commit it anyway just so people can see where I'm heading.
author
Glen Stampoultzis (glens at apache.org)

Fields Summary
Stack
formulaTokens
Constructors Summary
Methods Summary
public java.lang.Objectclone()

        try
        {
            // todo: clone tokens? or are they immutable?
            return super.clone();
        }
        catch ( CloneNotSupportedException e )
        {
            // should not happen
            return null;
        }
    
public intfillField(org.apache.poi.hssf.record.RecordInputStream in)

        short tokenSize = in.readShort();
        formulaTokens = Ptg.createParsedExpressionTokens(tokenSize, in);

        return tokenSize + 2;
    
public java.util.StackgetFormulaTokens()

        return (Stack)this.formulaTokens.clone();
    
public intgetSize()


      
    
        int size = 0;
        for ( Iterator iterator = formulaTokens.iterator(); iterator.hasNext(); )
        {
            Ptg token = (Ptg) iterator.next();
            size += token.getSize();
        }
        return size + 2;
    
public intserializeField(int offset, byte[] data)

        int size = getSize();
        LittleEndian.putShort(data, offset, (short)(size - 2));
        int pos = offset + 2;
        pos += Ptg.serializePtgStack(formulaTokens, data, pos);
        return size;
    
public voidsetFormulaTokens(java.util.Stack formulaTokens)

        this.formulaTokens = (Stack) formulaTokens.clone();
    
public voidtoString(java.lang.StringBuffer buffer)

        for ( int k = 0; k < formulaTokens.size(); k++ )
        {
            buffer.append( "Formula " )
                    .append( k )
                    .append( "=" )
                    .append( formulaTokens.get( k ).toString() )
                    .append( "\n" )
                    .append( ( (Ptg) formulaTokens.get( k ) ).toDebugString() )
                    .append( "\n" );
        }
    
public java.lang.StringtoString()

        StringBuffer b = new StringBuffer();
        toString( b );
        return b.toString();