org.apache.poi.hssf.record.formula
Class ArrayPtg

java.lang.Object
  extended by org.apache.poi.hssf.record.formula.Ptg
      extended by org.apache.poi.hssf.record.formula.ArrayPtg
Direct Known Subclasses:
ArrayPtgA, ArrayPtgV

public class ArrayPtg
extends Ptg

ArrayPtg - handles arrays The ArrayPtg is a little wierd, the size of the Ptg when parsing initially only includes the Ptg sid and the reserved bytes. The next Ptg in the expression then follows. It is only after the "size" of all the Ptgs is met, that the ArrayPtg data is actually held after this. So Ptg.createParsedExpression keeps track of the number of ArrayPtg elements and need to parse the data upto the FORMULA record size.

Author:
Jason Height (jheight at chariot dot net dot au)

Field Summary
protected  byte field_1_reserved
           
protected  byte field_2_reserved
           
protected  byte field_3_reserved
           
protected  byte field_4_reserved
           
protected  byte field_5_reserved
           
protected  byte field_6_reserved
           
protected  byte field_7_reserved
           
static byte sid
           
protected  short token_1_columns
           
protected  short token_2_rows
           
protected  java.lang.Object[][] token_3_arrayValues
           
 
Fields inherited from class org.apache.poi.hssf.record.formula.Ptg
CLASS_ARRAY, CLASS_REF, CLASS_VALUE, ptgClass
 
Constructor Summary
protected ArrayPtg()
           
  ArrayPtg(RecordInputStream in)
           
 
Method Summary
 java.lang.Object clone()
           
 short getColumnCount()
           
 byte getDefaultOperandClass()
           
 short getRowCount()
           
 int getSize()
          This size includes the size of the array Ptg plus the Array Ptg Token value size
 void readTokenValues(RecordInputStream in)
          Read in the actual token (array) values.
 void setColumnCount(short col)
           
 void setRowCount(short row)
           
 java.lang.String toFormulaString(Workbook book)
          return a string representation of this token alone
 java.lang.String toString()
          Overridden toString method to ensure object hash is not printed.
 void writeBytes(byte[] array, int offset)
          write this Ptg to a byte array
 int writeTokenValueBytes(byte[] array, int offset)
           
 
Methods inherited from class org.apache.poi.hssf.record.formula.Ptg
createParsedExpressionTokens, createPtg, getBytes, getPtgClass, serializePtgStack, setClass, toDebugString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sid

public static final byte sid
See Also:
Constant Field Values

field_1_reserved

protected byte field_1_reserved

field_2_reserved

protected byte field_2_reserved

field_3_reserved

protected byte field_3_reserved

field_4_reserved

protected byte field_4_reserved

field_5_reserved

protected byte field_5_reserved

field_6_reserved

protected byte field_6_reserved

field_7_reserved

protected byte field_7_reserved

token_1_columns

protected short token_1_columns

token_2_rows

protected short token_2_rows

token_3_arrayValues

protected java.lang.Object[][] token_3_arrayValues
Constructor Detail

ArrayPtg

protected ArrayPtg()

ArrayPtg

public ArrayPtg(RecordInputStream in)
Method Detail

readTokenValues

public void readTokenValues(RecordInputStream in)
Read in the actual token (array) values. This occurs AFTER the last Ptg in the expression.


toString

public java.lang.String toString()
Description copied from class: Ptg
Overridden toString method to ensure object hash is not printed. This helps get rid of gratuitous diffs when comparing two dumps Subclasses may output more relevant information by overriding this method

Overrides:
toString in class Ptg

writeBytes

public void writeBytes(byte[] array,
                       int offset)
Description copied from class: Ptg
write this Ptg to a byte array

Specified by:
writeBytes in class Ptg

writeTokenValueBytes

public int writeTokenValueBytes(byte[] array,
                                int offset)

setRowCount

public void setRowCount(short row)

getRowCount

public short getRowCount()

setColumnCount

public void setColumnCount(short col)

getColumnCount

public short getColumnCount()

getSize

public int getSize()
This size includes the size of the array Ptg plus the Array Ptg Token value size

Specified by:
getSize in class Ptg

toFormulaString

public java.lang.String toFormulaString(Workbook book)
Description copied from class: Ptg
return a string representation of this token alone

Specified by:
toFormulaString in class Ptg

getDefaultOperandClass

public byte getDefaultOperandClass()
Specified by:
getDefaultOperandClass in class Ptg

clone

public java.lang.Object clone()
Specified by:
clone in class Ptg


Copyright 2008 The Apache Software Foundation or its licensors, as applicable.