Package loci.poi.hssf.record.formula
Class AbstractFunctionPtg
- java.lang.Object
-
- loci.poi.hssf.record.formula.Ptg
-
- loci.poi.hssf.record.formula.OperationPtg
-
- loci.poi.hssf.record.formula.AbstractFunctionPtg
-
- Direct Known Subclasses:
FuncPtg
,FuncVarPtg
public abstract class AbstractFunctionPtg extends OperationPtg
This class provides the base functionality for Excel sheet functions There are two kinds of function Ptgs - tFunc and tFuncVar Therefore, this class will have ONLY two subclasses- Author:
- Avik Sengupta, Andrew C. Oliver (acoliver at apache dot org)
-
-
Field Summary
Fields Modifier and Type Field Description static String
ATTR_NAME
protected byte
field_1_num_args
protected short
field_2_fnc_index
protected static Object[][]
functionData
static short
INDEX_EXTERNAL
protected byte[]
paramClass
protected byte
returnClass
-
Fields inherited from class loci.poi.hssf.record.formula.OperationPtg
TYPE_BINARY, TYPE_FUNCTION, TYPE_UNARY
-
Fields inherited from class loci.poi.hssf.record.formula.Ptg
CLASS_ARRAY, CLASS_REF, CLASS_VALUE, ptgClass
-
-
Constructor Summary
Constructors Constructor Description AbstractFunctionPtg()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description byte
getDefaultOperandClass()
short
getFunctionIndex()
String
getName()
byte
getParameterClass(int index)
abstract int
getSize()
int
getType()
protected short
lookupIndex(String name)
protected String
lookupName(short index)
String
toFormulaString(String[] operands)
returns a string representation of the operations the length of the input array should equal the number returned byString
toFormulaString(Workbook book)
return a string representation of this token aloneString
toString()
Overridden toString method to ensure object hash is not printed.abstract void
writeBytes(byte[] array, int offset)
write this Ptg to a byte array-
Methods inherited from class loci.poi.hssf.record.formula.OperationPtg
getNumberOfOperands
-
Methods inherited from class loci.poi.hssf.record.formula.Ptg
clone, createParsedExpressionTokens, createPtg, getBytes, getPtgClass, serializePtgStack, setClass, toDebugString
-
-
-
-
Field Detail
-
ATTR_NAME
public static final String ATTR_NAME
- See Also:
- Constant Field Values
-
INDEX_EXTERNAL
public static final short INDEX_EXTERNAL
- See Also:
- Constant Field Values
-
functionData
protected static Object[][] functionData
-
returnClass
protected byte returnClass
-
paramClass
protected byte[] paramClass
-
field_1_num_args
protected byte field_1_num_args
-
field_2_fnc_index
protected short field_2_fnc_index
-
-
Method Detail
-
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
-
getType
public int getType()
- Specified by:
getType
in classOperationPtg
-
getFunctionIndex
public short getFunctionIndex()
-
getName
public String getName()
-
toFormulaString
public String toFormulaString(Workbook book)
Description copied from class:Ptg
return a string representation of this token alone- Specified by:
toFormulaString
in classPtg
-
toFormulaString
public String toFormulaString(String[] operands)
Description copied from class:OperationPtg
returns a string representation of the operations the length of the input array should equal the number returned by- Specified by:
toFormulaString
in classOperationPtg
- See Also:
OperationPtg.getNumberOfOperands()
-
writeBytes
public abstract void writeBytes(byte[] array, int offset)
Description copied from class:Ptg
write this Ptg to a byte array- Specified by:
writeBytes
in classPtg
-
lookupName
protected String lookupName(short index)
-
lookupIndex
protected short lookupIndex(String name)
-
getDefaultOperandClass
public byte getDefaultOperandClass()
- Overrides:
getDefaultOperandClass
in classOperationPtg
-
getParameterClass
public byte getParameterClass(int index)
-
-