MCPcopy Index your code
hub / github.com/benfry/processing4 / method

Method method

core/src/processing/core/PApplet.java:3447–3460  ·  view source on GitHub ↗

Call a method in the current class based on its name. Note that the function being called must be public. Inside the PDE, 'public' is automatically added, but when used without the preprocessor, (like from Eclipse) you'll have to do it yourself.

(String name)

Source from the content-addressed store, hash-verified

3445 * (like from Eclipse) you'll have to do it yourself.
3446 */
3447 public void method(String name) {
3448 try {
3449 Method method = getClass().getMethod(name);
3450 method.invoke(this);
3451
3452 } catch (IllegalArgumentException | IllegalAccessException e) {
3453 e.printStackTrace();
3454 } catch (InvocationTargetException e) {
3455 e.getTargetException().printStackTrace();
3456 } catch (NoSuchMethodException nsme) {
3457 System.err.println("There is no public " + name + "() method " +
3458 "in the class " + getClass().getName());
3459 }
3460 }
3461
3462
3463 /**

Callers 3

threadMethod · 0.95
locationToStringMethod · 0.80
printSourceLocationMethod · 0.80

Calls 4

getMethodMethod · 0.80
printStackTraceMethod · 0.45
printlnMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected