public class FunctionPointer extends Object
| Constructor and Description |
|---|
FunctionPointer(String functionName,
int argCount)
Create a function pointer reference using a function name of the format
<class>:<method>.
|
FunctionPointer(String className,
String function,
int argCount)
Create a function pointer reference.
|
public FunctionPointer(String functionName, int argCount) throws ClassNotFoundException, NoSuchMethodException
functionName - a function name.argCount - number of Object.class arguments that the function takesClassNotFoundException - thrown if class not foundNoSuchMethodException - thrown if no method is foundpublic FunctionPointer(String className, String function, int argCount) throws ClassNotFoundException, NoSuchMethodException
className - name of the classfunction - static function to call in the classargCount - number of Object.class arguments that the function takesClassNotFoundException - thrown if class not foundNoSuchMethodException - thrown if no method is foundpublic Object invoke(Object... args) throws IllegalAccessException, InvocationTargetException, IllegalArgumentException
args - the arguments to pass to the function pointerIllegalAccessException - thrown if method is not accessibleInvocationTargetException - thrown if target function is invalidIllegalArgumentException - thrown if the arguments don't matchCopyright © 2020. All rights reserved.