Package org.apache.poi.ss.formula.ptg
Class AbstractFunctionPtg
- java.lang.Object
-
- org.apache.poi.ss.formula.ptg.Ptg
-
- org.apache.poi.ss.formula.ptg.OperationPtg
-
- org.apache.poi.ss.formula.ptg.AbstractFunctionPtg
-
- All Implemented Interfaces:
org.apache.poi.common.Duplicatable
,GenericRecord
- 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
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
FUNCTION_NAME_IF
The name of the IF function (i.e.-
Fields inherited from class org.apache.poi.ss.formula.ptg.OperationPtg
TYPE_BINARY, TYPE_FUNCTION, TYPE_UNARY
-
Fields inherited from class org.apache.poi.ss.formula.ptg.Ptg
CLASS_ARRAY, CLASS_REF, CLASS_VALUE, EMPTY_PTG_ARRAY
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description byte
getDefaultOperandClass()
short
getFunctionIndex()
java.util.Map<java.lang.String,java.util.function.Supplier<?>>
getGenericProperties()
java.lang.String
getName()
int
getNumberOfOperands()
The number of operands expected by the operationsbyte
getParameterClass(int index)
abstract int
getSize()
boolean
isBaseToken()
static boolean
isBuiltInFunctionName(java.lang.String name)
Used to detect whether a function name found in a formula is one of the standard excel functionsboolean
isExternalFunction()
external functions get some special processingjava.lang.String
toFormulaString()
return a string representation of this token alonejava.lang.String
toFormulaString(java.lang.String[] operands)
returns a string representation of the operations the length of the input array should equal the number returned by-
Methods inherited from class org.apache.poi.ss.formula.ptg.Ptg
copy, createPtg, doesFormulaReferToDeletedCell, getEncodedSize, getEncodedSizeWithoutArrayData, getPtgClass, getRVAType, getSid, readTokens, serializePtgs, setClass, toString, write
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.poi.common.usermodel.GenericRecord
getGenericChildren, getGenericRecordType
-
-
-
-
Field Detail
-
FUNCTION_NAME_IF
public static final java.lang.String FUNCTION_NAME_IF
The name of the IF function (i.e. "IF"). Extracted as a constant for clarity.- See Also:
- Constant Field Values
-
-
Method Detail
-
isBaseToken
public final boolean isBaseToken()
- Specified by:
isBaseToken
in classPtg
- Returns:
false
if this token is classified as 'reference', 'value', or 'array'
-
getFunctionIndex
public final short getFunctionIndex()
-
getNumberOfOperands
public final int getNumberOfOperands()
Description copied from class:OperationPtg
The number of operands expected by the operations- Specified by:
getNumberOfOperands
in classOperationPtg
-
getName
public final java.lang.String getName()
-
isExternalFunction
public final boolean isExternalFunction()
external functions get some special processing- Returns:
true
if this is an external function
-
toFormulaString
public final java.lang.String toFormulaString()
Description copied from class:Ptg
return a string representation of this token alone- Specified by:
toFormulaString
in classPtg
-
toFormulaString
public java.lang.String toFormulaString(java.lang.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()
-
getSize
public abstract int getSize()
-
isBuiltInFunctionName
public static boolean isBuiltInFunctionName(java.lang.String name)
Used to detect whether a function name found in a formula is one of the standard excel functionsThe name matching is case insensitive.
- Returns:
true
if the name specifies a standard worksheet function,false
if the name should be assumed to be an external function.
-
getDefaultOperandClass
public byte getDefaultOperandClass()
- Overrides:
getDefaultOperandClass
in classOperationPtg
-
getParameterClass
public final byte getParameterClass(int index)
-
getGenericProperties
public java.util.Map<java.lang.String,java.util.function.Supplier<?>> getGenericProperties()
- Specified by:
getGenericProperties
in interfaceGenericRecord
- Overrides:
getGenericProperties
in classOperationPtg
-
-