Class StaticMethodGeometryFunction

    • Field Detail

      • PARAM_NAME_COUNT

        private static final java.lang.String PARAM_NAME_COUNT
        See Also:
        Constant Field Values
      • PARAM_NAME_DISTANCE

        private static final java.lang.String PARAM_NAME_DISTANCE
        See Also:
        Constant Field Values
      • FUNCTIONS_SUFFIX

        private static final java.lang.String FUNCTIONS_SUFFIX
        See Also:
        Constant Field Values
      • method

        private java.lang.reflect.Method method
    • Constructor Detail

      • StaticMethodGeometryFunction

        public StaticMethodGeometryFunction​(java.lang.String category,
                                            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 Detail

      • extractCategory

        private static java.lang.String extractCategory​(java.lang.String className)
      • extractParamNames

        private static java.lang.String[] extractParamNames​(java.lang.reflect.Method method)
        Java doesn't permit accessing the original code parameter names, unfortunately.
        Parameters:
        method -
        Returns:
      • defaultParamNames

        private static java.lang.String[] defaultParamNames​(java.lang.reflect.Method method)
      • firstScalarParamIndex

        private static int firstScalarParamIndex​(java.lang.reflect.Method method)
      • paramNamePrimary

        private static java.lang.String paramNamePrimary​(java.lang.Class<?> clz)
      • extractDescription

        private static java.lang.String extractDescription​(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 be RuntimeExceptions.
        Specified by:
        invoke in interface GeometryFunction
        Specified by:
        invoke in class BaseGeometryFunction
        Parameters:
        g - the target geometry
        arg - 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)