Class FunctionService

    • Constructor Detail

      • FunctionService

        public FunctionService()
        Construct a new function service.
    • Method Detail

      • getInstance

        public static FunctionService getInstance()
        Get the singleton instance of the function service.
        Returns:
        the service instance
      • load

        @NonNull
        public IFunctionLibrary load()
        Load all known functions registered with this function service.
        Returns:
        the function library
      • getFunction

        public IFunction getFunction​(@NonNull
                                     String name,
                                     @NonNull
                                     IExpression... arguments)
        Retrieve the function with the provided name that supports the signature of the provided methods, if such a function exists.
        Parameters:
        name - the name of a group of functions
        arguments - a list of argument expressions for use in determining an argument signature match
        Returns:
        the matching function or null if no match exists
        Throws:
        StaticMetapathException - if a matching function was not found
      • getFunction

        public IFunction getFunction​(@NonNull
                                     String name,
                                     @NonNull
                                     List<IExpression> arguments)
        Retrieve the function with the provided name that supports the signature of the provided methods, if such a function exists.
        Parameters:
        name - the name of a group of functions
        arguments - a list of argument expressions for use in determining an argument signature match
        Returns:
        the matching function
        Throws:
        StaticMetapathException - if a matching function was not found