Package org.locationtech.jtstest.geomop
Class GeometryMethodOperation
java.lang.Object
org.locationtech.jtstest.geomop.GeometryMethodOperation
- All Implemented Interfaces:
GeometryOperation
Invokes a named operation on a set of arguments,
the first of which is a
Geometry
.
This class provides operations which are the methods
defined on the Geometry class.
Other GeometryOperation
classes can delegate to
instances of this class to run standard Geometry methods.- Version:
- 1.7
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate boolean
convertArg
(Class destClass, Object srcValue, Object[] convArg) private boolean
convertArgFromString
(Class destClass, String srcStr, Object[] convArg) private boolean
convertArgs
(Class[] parameterTypes, Object[] args, Object[] actualArgs) private Method
getGeometryMethod
(String opName, Object[] args, Object[] actualArgs) static Class
getGeometryReturnType
(String functionName) getReturnType
(String opName) Gets the class of the return type of the given operation.Invokes an operation on aGeometry
.private Result
invokeMethod
(Method method, Geometry geometry, Object[] args) static boolean
isBooleanFunction
(String name) static boolean
isDoubleFunction
(String name) static boolean
isGeometryFunction
(String name) static boolean
isIntegerFunction
(String name) private static int
nonNullItemCount
(Object[] obj)
-
Field Details
-
geometryMethods
-
convArg
-
-
Constructor Details
-
GeometryMethodOperation
public GeometryMethodOperation()
-
-
Method Details
-
isBooleanFunction
-
isIntegerFunction
-
isDoubleFunction
-
isGeometryFunction
-
getGeometryReturnType
-
getReturnType
Description copied from interface:GeometryOperation
Gets the class of the return type of the given operation.- Specified by:
getReturnType
in interfaceGeometryOperation
- Parameters:
opName
- the name of the operation- Returns:
- the class of the return type of the specified operation
-
invoke
Description copied from interface:GeometryOperation
Invokes an operation on aGeometry
.- Specified by:
invoke
in interfaceGeometryOperation
- Parameters:
opName
- name of the operationgeometry
- the geometry to processargs
- the arguments to the operation (which may be typed as Strings)- Returns:
- the result of the operation
- Throws:
Exception
- if some error was encountered trying to find or process the operation
-
getGeometryMethod
-
nonNullItemCount
-
convertArgs
-
convertArg
-
convertArgFromString
-
invokeMethod
- Throws:
Exception
-