Package org.locationtech.jtstest.geomop
Class StaticMethodGeometryFunction
- java.lang.Object
-
- org.locationtech.jtstest.geomop.BaseGeometryFunction
-
- org.locationtech.jtstest.geomop.StaticMethodGeometryFunction
-
- All Implemented Interfaces:
java.lang.Comparable
,GeometryFunction
public class StaticMethodGeometryFunction extends BaseGeometryFunction
AGeometryFunction
which calls a staticMethod
.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
DESCRIPTION_SUFFIX
private static java.lang.String
FUNCTIONS_SUFFIX
private java.lang.reflect.Method
method
private static java.lang.String
PARAMETERS_SUFFIX
-
Fields inherited from class org.locationtech.jtstest.geomop.BaseGeometryFunction
category, description, name, parameterNames, parameterTypes, returnType
-
-
Constructor Summary
Constructors Constructor Description StaticMethodGeometryFunction(java.lang.String name, java.lang.String description, java.lang.String[] parameterNames, java.lang.Class[] parameterTypes, java.lang.Class returnType, java.lang.reflect.Method method)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static java.lang.Object[]
createFullArgs(Geometry g, java.lang.Object[] arg)
Creates an arg array which includes the target geometry as the first argumentstatic StaticMethodGeometryFunction
createFunction(java.lang.reflect.Method method)
private static java.lang.Class[]
extractParamTypes(java.lang.reflect.Method method)
static java.lang.String
getClassname(java.lang.Class javaClass)
private static java.lang.String
invocationErrMsg(java.lang.reflect.InvocationTargetException ex)
static java.lang.Object
invoke(java.lang.reflect.Method method, java.lang.Object target, java.lang.Object[] args)
java.lang.Object
invoke(Geometry g, java.lang.Object[] arg)
Invokes this function.-
Methods inherited from class org.locationtech.jtstest.geomop.BaseGeometryFunction
compareTo, equals, getCategory, getDescription, getDoubleOrNull, getIntegerOrNull, getName, getParameterNames, getParameterTypes, getReturnType, isBinary, isBinaryGeomFunction
-
-
-
-
Field Detail
-
FUNCTIONS_SUFFIX
private static final java.lang.String FUNCTIONS_SUFFIX
- See Also:
- Constant Field Values
-
PARAMETERS_SUFFIX
private static final java.lang.String PARAMETERS_SUFFIX
- See Also:
- Constant Field Values
-
DESCRIPTION_SUFFIX
private static final java.lang.String DESCRIPTION_SUFFIX
- See Also:
- Constant Field Values
-
method
private java.lang.reflect.Method method
-
-
Method Detail
-
createFunction
public static StaticMethodGeometryFunction createFunction(java.lang.reflect.Method method)
-
extractParamTypes
private static java.lang.Class[] extractParamTypes(java.lang.reflect.Method method)
-
invoke
public java.lang.Object invoke(Geometry g, java.lang.Object[] arg)
Description copied from interface:GeometryFunction
Invokes this function. Note that any exceptions returned must beRuntimeException
s.- Specified by:
invoke
in interfaceGeometryFunction
- Specified by:
invoke
in classBaseGeometryFunction
- Parameters:
g
- the target geometryarg
- the other arguments to the function- Returns:
- the value computed by the function
-
createFullArgs
private static java.lang.Object[] createFullArgs(Geometry g, java.lang.Object[] arg)
Creates an arg array which includes the target geometry as the first argument- Parameters:
g
-arg
-- Returns:
-
invoke
public static java.lang.Object invoke(java.lang.reflect.Method method, java.lang.Object target, java.lang.Object[] args)
-
invocationErrMsg
private static java.lang.String invocationErrMsg(java.lang.reflect.InvocationTargetException ex)
-
getClassname
public static java.lang.String getClassname(java.lang.Class javaClass)
-
-