JavaInvokeModule_(ModuleId: String, ClassName: String, MethodName: String, MethodSig: String, Params: Array)
ModuleId. Java module identifier in a repository.
ClassName. Class name. Parameter value is case-sensitive.
MethodName. The executed method name. Parameter value is case-sensitive.
MethodSig. JNI signature of the method.
Params. Parameters sent to method. Values of parameters can be sent as a separate array or enumerated via a comma. If the executed method does not contain input parameters, do not specify Params.
The JavaInvokeModule_ method executes static method stored in the Java module, and returns the result of its work.
Consider the Java code contained in the Java module with the MOD_JAVA identifier:
public class math {
public static double staticFunc(double a, double b){
return (a + b)/2;
}
}
The table contains examples of formulas using the JavaInvokeModule_method:
Formula | Result | Description |
=JavaInvokeModule_("MOD_JAVA", "math", "staticFunc", "(DD)D", 4.0, 2.0) | 3.0 | The staticFunc arithmetic function is executed in the class named math. Parameters of real types are specified in the function - the a variable is set to 4.0, the b variable is set to 2.0. The method returns arithmetic function calculation result. |
=JavaInvokeModule_("MOD_JAVA", "math", "staticFunc", "(DD)D", C3, C4) | 5.0 | The arithmetic staticFunc function is executed in the class named math. Parameters of real types are specified in the function - the a variable is set to the value specified in the C3 cell, the b variable is set to the value specified in the C4 cell. Value contained in the C3 cell is 4.0, in the C4 cell - 6.0. The method returns arithmetic function calculation result. |
See also:
Functions Available in Expression Editor | Working with Java | Java.InvokeModule