Class GeometryFunctionRegistry
- java.lang.Object
-
- org.locationtech.jtstest.geomfunction.GeometryFunctionRegistry
-
public class GeometryFunctionRegistry extends Object
A registry to manage a collection ofGeometryFunction
s.- Author:
- Martin Davis
-
-
Constructor Summary
Constructors Constructor Description GeometryFunctionRegistry()
GeometryFunctionRegistry(Class<?> clz)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(Class<?> geomFuncClass)
Adds functions for all the static methods in the given class.void
add(String geomFuncClassname)
Adds functions for all the static methods in the given class.void
add(Collection<StaticMethodGeometryFunction> funcs)
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.List<StaticMethodGeometryFunction>
createFunctions(Class<?> functionClass)
CreateGeometryFunction
s for all the static methods in the given classstatic GeometryFunctionRegistry
createTestBuilderRegistry()
GeometryFunction
find(String name)
Finds the first function which matches the given name.GeometryFunction
find(String name, int argCount)
Finds the first function which matches the given name and argument count.GeometryFunction
find(String name, Class<Object>[] paramTypes)
Finds the first function which matches the given signature.GeometryFunction
find(String category, String name)
Finds the first function which matches the given category and name.static String
functionDescriptionHTML(GeometryFunction func)
Collection<?>
getCategories()
DoubleKeyMap
getCategorizedGeometryFunctions()
DoubleKeyMap
getCategorizedScalarFunctions()
List<GeometryFunction>
getFunctions()
Collection<?>
getFunctions(String category)
List<GeometryFunction>
getGeometryFunctions()
List<GeometryFunction>
getScalarFunctions()
static boolean
hasGeometryResult(GeometryFunction func)
static boolean
isGeometryFunction(Method method)
-
-
-
Constructor Detail
-
GeometryFunctionRegistry
public GeometryFunctionRegistry()
-
GeometryFunctionRegistry
public GeometryFunctionRegistry(Class<?> clz)
-
-
Method Detail
-
createTestBuilderRegistry
public static GeometryFunctionRegistry createTestBuilderRegistry()
-
functionDescriptionHTML
public static String functionDescriptionHTML(GeometryFunction func)
-
getFunctions
public List<GeometryFunction> getFunctions()
-
getGeometryFunctions
public List<GeometryFunction> getGeometryFunctions()
-
hasGeometryResult
public static boolean hasGeometryResult(GeometryFunction func)
-
getScalarFunctions
public List<GeometryFunction> getScalarFunctions()
-
add
public void add(Class<?> geomFuncClass)
Adds functions for all the static methods in the given class.- Parameters:
geomFuncClass
-
-
add
public void add(String geomFuncClassname) throws ClassNotFoundException
Adds functions for all the static methods in the given class.- Parameters:
geomFuncClassname
- the name of the class to load and extract functions from- Throws:
ClassNotFoundException
-
add
public void add(Collection<StaticMethodGeometryFunction> funcs)
-
createFunctions
public List<StaticMethodGeometryFunction> createFunctions(Class<?> functionClass)
CreateGeometryFunction
s for all the static methods in the given class- Parameters:
functionClass
-- Returns:
- a list of the functions created
-
isGeometryFunction
public static boolean isGeometryFunction(Method method)
-
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 Collection<?> getCategories()
-
getFunctions
public Collection<?> getFunctions(String category)
-
find
public GeometryFunction find(String name, Class<Object>[] paramTypes)
Finds the first function which matches the given signature.- Parameters:
name
-paramTypes
-- Returns:
- a matching function, or null
-
find
public GeometryFunction find(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(String name)
Finds the first function which matches the given name.- Parameters:
name
-- Returns:
- a matching function, or null
-
find
public GeometryFunction find(String category, String name)
Finds the first function which matches the given category and name.- Parameters:
name
-- Returns:
- a matching function, or null
-
-