Class AbstractFunctionFactory

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addFunction​(java.lang.String name, java.lang.String category, Function f)  
      protected void addFunction​(java.lang.String name, java.lang.String category, Function f, boolean visible)  
      java.util.Set<java.lang.String> getCategories()
      Return a sequence of categories to organize functions.
      Function getFunction​(java.lang.String name)
      Retrieves the function with the given name.
      java.util.Set<java.lang.String> getFunctionNames()
      Returns a set of all function names.
      java.util.Set<java.lang.String> getFunctionsInCategory​(java.lang.String name)
      Returns a Set of function names for all of the functions in the given category.
      • Methods inherited from class java.lang.Object

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

      • functions

        protected java.util.Map<java.lang.String,​Function> functions
      • categories

        protected java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​Function>> categories
    • Constructor Detail

      • AbstractFunctionFactory

        public AbstractFunctionFactory​(FunctionFactory parent)
    • Method Detail

      • addFunction

        public void addFunction​(java.lang.String name,
                                java.lang.String category,
                                Function f)
                         throws java.lang.IllegalArgumentException
        Throws:
        java.lang.IllegalArgumentException
      • addFunction

        protected void addFunction​(java.lang.String name,
                                   java.lang.String category,
                                   Function f,
                                   boolean visible)
                            throws java.lang.IllegalArgumentException
        Throws:
        java.lang.IllegalArgumentException
      • getFunction

        public Function getFunction​(java.lang.String name)
        Retrieves the function with the given name. Returns a copy of that function, so that each FunctionExpression can have its own version of the function. NB - some functions may opt to not create a true copy, it depends on the serialization requirements of the function.
        Specified by:
        getFunction in interface FunctionFactory
        Returns:
        The function, or null
      • getCategories

        public java.util.Set<java.lang.String> getCategories()
        Description copied from interface: FunctionFactory
        Return a sequence of categories to organize functions. Used to generate the popup menu in the designer. Will automatically organize into submenus based on forward-slash in path.
        Specified by:
        getCategories in interface FunctionFactory
      • getFunctionsInCategory

        public java.util.Set<java.lang.String> getFunctionsInCategory​(java.lang.String name)
        Returns a Set of function names for all of the functions in the given category. If there are no functions in the given category, or the category doesn't exist, an empty set is returned.
        Specified by:
        getFunctionsInCategory in interface FunctionFactory
      • getFunctionNames

        public java.util.Set<java.lang.String> getFunctionNames()
        Returns a set of all function names.
        Specified by:
        getFunctionNames in interface FunctionFactory