Class GeometryFunctionRegistry
- java.lang.Object
-
- org.locationtech.jtstest.geomfunction.GeometryFunctionRegistry
-
public class GeometryFunctionRegistry extends java.lang.ObjectA registry to manage a collection ofGeometryFunctions.
-
-
Field Summary
Fields Modifier and Type Field Description private DoubleKeyMapcategorizedFunctionsprivate DoubleKeyMapcategorizedGeometryFunctionsprivate DoubleKeyMapcategorizedScalarFunctionsprivate java.util.Listfunctionsprivate java.util.MapsortedFunctions
-
Constructor Summary
Constructors Constructor Description GeometryFunctionRegistry()GeometryFunctionRegistry(java.lang.Class clz)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(java.lang.Class geomFuncClass)Adds functions for all the static methods in the given class.voidadd(java.lang.String geomFuncClassname)Adds functions for all the static methods in the given class.voidadd(java.util.Collection funcs)voidadd(GeometryFunction func)Adds a function if it does not currently exist in the registry, or replaces the existing one with the same signature.java.util.ListcreateFunctions(java.lang.Class functionClass)CreateGeometryFunctions for all the static methods in the given classstatic GeometryFunctionRegistrycreateTestBuilderRegistry()GeometryFunctionfind(java.lang.String name)Finds the first function which matches the given name.GeometryFunctionfind(java.lang.String name, int argCount)Finds the first function which matches the given name and argument count.GeometryFunctionfind(java.lang.String name, java.lang.Class[] paramTypes)Finds the first function which matches the given signature.static java.lang.StringfunctionDescriptionHTML(GeometryFunction func)java.util.CollectiongetCategories()DoubleKeyMapgetCategorizedGeometryFunctions()DoubleKeyMapgetCategorizedScalarFunctions()java.util.ListgetFunctions()java.util.CollectiongetFunctions(java.lang.String category)java.util.ListgetGeometryFunctions()java.util.ListgetScalarFunctions()static booleanhasGeometryResult(GeometryFunction func)
-
-
-
Field Detail
-
functions
private java.util.List functions
-
sortedFunctions
private java.util.Map sortedFunctions
-
categorizedFunctions
private DoubleKeyMap categorizedFunctions
-
categorizedGeometryFunctions
private DoubleKeyMap categorizedGeometryFunctions
-
categorizedScalarFunctions
private DoubleKeyMap categorizedScalarFunctions
-
-
Method Detail
-
createTestBuilderRegistry
public static GeometryFunctionRegistry createTestBuilderRegistry()
-
functionDescriptionHTML
public static java.lang.String functionDescriptionHTML(GeometryFunction func)
-
getFunctions
public java.util.List getFunctions()
-
getGeometryFunctions
public java.util.List getGeometryFunctions()
-
hasGeometryResult
public static boolean hasGeometryResult(GeometryFunction func)
-
getScalarFunctions
public java.util.List getScalarFunctions()
-
add
public void add(java.lang.Class geomFuncClass)
Adds functions for all the static methods in the given class.- Parameters:
geomFuncClass-
-
add
public void add(java.lang.String geomFuncClassname) throws java.lang.ClassNotFoundExceptionAdds functions for all the static methods in the given class.- Parameters:
geomFuncClassname- the name of the class to load and extract functions from- Throws:
java.lang.ClassNotFoundException
-
add
public void add(java.util.Collection funcs)
-
createFunctions
public java.util.List createFunctions(java.lang.Class functionClass)
CreateGeometryFunctions for all the static methods in the given class- Parameters:
functionClass-- Returns:
- a list of the functions created
-
add
public void add(GeometryFunction func)
Adds a function if it does not currently exist in the registry, or replaces the existing one with the same signature.- Parameters:
func- a function
-
getCategorizedGeometryFunctions
public DoubleKeyMap getCategorizedGeometryFunctions()
-
getCategorizedScalarFunctions
public DoubleKeyMap getCategorizedScalarFunctions()
-
getCategories
public java.util.Collection getCategories()
-
getFunctions
public java.util.Collection getFunctions(java.lang.String category)
-
find
public GeometryFunction find(java.lang.String name, java.lang.Class[] paramTypes)
Finds the first function which matches the given signature.- Parameters:
name-paramTypes-- Returns:
- a matching function, or null
-
find
public GeometryFunction find(java.lang.String name, int argCount)
Finds the first function which matches the given name and argument count.- Parameters:
name-- Returns:
- a matching function, or null
-
find
public GeometryFunction find(java.lang.String name)
Finds the first function which matches the given name.- Parameters:
name-- Returns:
- a matching function, or null
-
-