Package loci.poi.hssf.record.formula
Class ArrayPtg
- java.lang.Object
-
- loci.poi.hssf.record.formula.Ptg
-
- loci.poi.hssf.record.formula.ArrayPtg
-
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
Fields Modifier and Type Field Description 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 Object[][]
token_3_arrayValues
-
Fields inherited from class loci.poi.hssf.record.formula.Ptg
CLASS_ARRAY, CLASS_REF, CLASS_VALUE, ptgClass
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ArrayPtg()
ArrayPtg(RecordInputStream in)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 sizevoid
readTokenValues(RecordInputStream in)
Read in the actual token (array) values.void
setColumnCount(short col)
void
setRowCount(short row)
String
toFormulaString(Workbook book)
return a string representation of this token aloneString
toString()
Overridden toString method to ensure object hash is not printed.void
writeBytes(byte[] array, int offset)
write this Ptg to a byte arrayint
writeTokenValueBytes(byte[] array, int offset)
-
Methods inherited from class loci.poi.hssf.record.formula.Ptg
createParsedExpressionTokens, createPtg, getBytes, getPtgClass, serializePtgStack, setClass, toDebugString
-
-
-
-
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 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 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
-
writeBytes
public void writeBytes(byte[] array, int offset)
Description copied from class:Ptg
write this Ptg to a byte array- Specified by:
writeBytes
in classPtg
-
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
-
toFormulaString
public String toFormulaString(Workbook book)
Description copied from class:Ptg
return a string representation of this token alone- Specified by:
toFormulaString
in classPtg
-
getDefaultOperandClass
public byte getDefaultOperandClass()
- Specified by:
getDefaultOperandClass
in classPtg
-
-