Class AbstractFunctionPtg

    • Field Detail

      • FUNCTION_NAME_IF

        public static final String FUNCTION_NAME_IF
        The name of the IF function (i.e. "IF"). Extracted as a constant for clarity.
        See Also:
        Constant Field Values
    • Constructor Detail

      • AbstractFunctionPtg

        protected AbstractFunctionPtg​(int functionIndex,
                                      int pReturnClass,
                                      byte[] paramTypes,
                                      int nParams)
    • Method Detail

      • isBaseToken

        public final boolean isBaseToken()
        Specified by:
        isBaseToken in class Ptg
        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 class OperationPtg
      • getName

        public final String getName()
      • isExternalFunction

        public final boolean isExternalFunction()
        external functions get some special processing
        Returns:
        true if this is an external function
      • toFormulaString

        public final String toFormulaString()
        Description copied from class: Ptg
        return a string representation of this token alone
        Specified by:
        toFormulaString in class Ptg
      • isBuiltInFunctionName

        public static boolean isBuiltInFunctionName​(String name)
        Used to detect whether a function name found in a formula is one of the standard excel functions

        The 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.
      • lookupName

        protected String lookupName​(short index)
      • lookupName

        protected final String lookupName​(short index,
                                          boolean isCetab)
      • lookupIndex

        protected static short lookupIndex​(String name)
        Resolves internal function names into function indexes.

        The name matching is case insensitive.

        Returns:
        the standard worksheet function index if found, otherwise FUNCTION_INDEX_EXTERNAL
      • getParameterClass

        public final byte getParameterClass​(int index)