public class GeometryMethodOperation extends java.lang.Object implements GeometryOperation
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.Modifier and Type | Field and Description |
---|---|
private java.lang.Object[] |
convArg |
private java.lang.reflect.Method[] |
geometryMethods |
Constructor and Description |
---|
GeometryMethodOperation() |
Modifier and Type | Method and Description |
---|---|
private boolean |
convertArg(java.lang.Class destClass,
java.lang.Object srcValue,
java.lang.Object[] convArg) |
private boolean |
convertArgFromString(java.lang.Class destClass,
java.lang.String srcStr,
java.lang.Object[] convArg) |
private boolean |
convertArgs(java.lang.Class[] parameterTypes,
java.lang.Object[] args,
java.lang.Object[] actualArgs) |
private java.lang.reflect.Method |
getGeometryMethod(java.lang.String opName,
java.lang.Object[] args,
java.lang.Object[] actualArgs) |
static java.lang.Class |
getGeometryReturnType(java.lang.String functionName) |
java.lang.Class |
getReturnType(java.lang.String opName)
Gets the class of the return type of the given operation.
|
Result |
invoke(java.lang.String opName,
Geometry geometry,
java.lang.Object[] args)
Invokes an operation on a
Geometry . |
private Result |
invokeMethod(java.lang.reflect.Method method,
Geometry geometry,
java.lang.Object[] args) |
static boolean |
isBooleanFunction(java.lang.String name) |
static boolean |
isDoubleFunction(java.lang.String name) |
static boolean |
isGeometryFunction(java.lang.String name) |
static boolean |
isIntegerFunction(java.lang.String name) |
private static int |
nonNullItemCount(java.lang.Object[] obj) |
private java.lang.reflect.Method[] geometryMethods
private java.lang.Object[] convArg
public static boolean isBooleanFunction(java.lang.String name)
public static boolean isIntegerFunction(java.lang.String name)
public static boolean isDoubleFunction(java.lang.String name)
public static boolean isGeometryFunction(java.lang.String name)
public static java.lang.Class getGeometryReturnType(java.lang.String functionName)
public java.lang.Class getReturnType(java.lang.String opName)
GeometryOperation
getReturnType
in interface GeometryOperation
opName
- the name of the operationpublic Result invoke(java.lang.String opName, Geometry geometry, java.lang.Object[] args) throws java.lang.Exception
GeometryOperation
Geometry
.invoke
in interface GeometryOperation
opName
- name of the operationgeometry
- the geometry to processargs
- the arguments to the operation (which may be typed as Strings)java.lang.Exception
- if some error was encountered trying to find or process the operationprivate java.lang.reflect.Method getGeometryMethod(java.lang.String opName, java.lang.Object[] args, java.lang.Object[] actualArgs)
private static int nonNullItemCount(java.lang.Object[] obj)
private boolean convertArgs(java.lang.Class[] parameterTypes, java.lang.Object[] args, java.lang.Object[] actualArgs)
private boolean convertArg(java.lang.Class destClass, java.lang.Object srcValue, java.lang.Object[] convArg)
private boolean convertArgFromString(java.lang.Class destClass, java.lang.String srcStr, java.lang.Object[] convArg)