[]
        
(Showing Draft Content)

CustomFunction

Class CustomFunction

java.lang.Object
com.grapecity.documents.excel.CustomFunction
Direct Known Subclasses:
AsyncCustomFunction

public abstract class CustomFunction extends Object
Represents the base type for custom function.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Initializes an instance of a custom function.
    CustomFunction(String name, FunctionValueType result, Parameter[] parameters)
    Initializes an instance of a custom function.
    CustomFunction(String name, String description, FunctionValueType result, Parameter[] parameters)
    Initializes an instance of a custom function.
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract Object
    evaluate(Object[] arguments, ICalcContext context)
    Calculate the function.
    boolean
    Gets whether the function can accept error values as arguments.
    If true, error values (e.g., #N/A, #VALUE!) are passed to the function for handling.
    If false (default), the function immediately returns an error if any argument is an error.
    boolean
    Gets whether to allow custom formula use cache.
    void
    setAcceptErrors(boolean acceptErrors)
    Sets whether the function can accept error values as arguments.
    If true, error values (e.g., #N/A, #VALUE!) are passed to the function for handling.
    If false (default), the function immediately returns an error if any argument is an error.
    void
    setIsVolatile(boolean aVolatile)
    Sets whether to allow custom formula use cache.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • CustomFunction

      public CustomFunction(String name, FunctionValueType result)
      Initializes an instance of a custom function.
      Parameters:
      name - The name of the custom function.
      result - Specifies the return type for the custom function.
    • CustomFunction

      public CustomFunction(String name, FunctionValueType result, Parameter[] parameters)
      Initializes an instance of a custom function.
      Parameters:
      name - The name of the custom function.
      result - Specifies the return type for the custom function.
      parameters - Specifies the parmeters for the custom function.
    • CustomFunction

      public CustomFunction(String name, String description, FunctionValueType result, Parameter[] parameters)
      Initializes an instance of a custom function.
      Parameters:
      name - The name of the custom function.
      description - The description of the custom function.
      result - Specifies the return type for the custom function.
      parameters - Specifies the parmeters for the custom function.
  • Method Details

    • setAcceptErrors

      public void setAcceptErrors(boolean acceptErrors)
      Sets whether the function can accept error values as arguments.
      If true, error values (e.g., #N/A, #VALUE!) are passed to the function for handling.
      If false (default), the function immediately returns an error if any argument is an error.
    • getAcceptErrors

      public boolean getAcceptErrors()
      Gets whether the function can accept error values as arguments.
      If true, error values (e.g., #N/A, #VALUE!) are passed to the function for handling.
      If false (default), the function immediately returns an error if any argument is an error.
    • getIsVolatile

      public boolean getIsVolatile()
      Gets whether to allow custom formula use cache.
      Returns:
      true if this node is marked as volatile, false otherwise.
    • setIsVolatile

      public void setIsVolatile(boolean aVolatile)
      Sets whether to allow custom formula use cache.
      Parameters:
      aVolatile - true to mark this node as volatile, false otherwise.
    • evaluate

      public abstract Object evaluate(Object[] arguments, ICalcContext context)
      Calculate the function.
      Parameters:
      arguments - the value collection of the arguments
      context - the context of the calculation.
      Returns:
      the result of the function.