MCPcopy Index your code
hub / github.com/BruceEckel/OnJava8-Examples / Apply

Class Apply

generics/Apply.java:8–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6import java.util.*;
7
8public class Apply {
9 public static <T, S extends Iterable<T>>
10 void apply(S seq, Method f, Object... args) {
11 try {
12 for(T t: seq)
13 f.invoke(t, args);
14 } catch(IllegalAccessException |
15 IllegalArgumentException |
16 InvocationTargetException e) {
17 // Failures are programmer errors
18 throw new RuntimeException(e);
19 }
20 }
21}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected