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

Method run

lowlevel/EvenChecker.java:17–25  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

15 this.id = id;
16 }
17 @Override public void run() {
18 while(!generator.isCanceled()) {
19 int val = generator.next();
20 if(val % 2 != 0) {
21 System.out.println(val + " not even!");
22 generator.cancel(); // Cancels all EvenCheckers
23 }
24 }
25 }
26 // Test any IntGenerator:
27 public static void test(IntGenerator gp, int count) {
28 List<CompletableFuture<Void>> checkers =

Callers

nothing calls this directly

Calls 3

isCanceledMethod · 0.80
cancelMethod · 0.80
nextMethod · 0.65

Tested by

no test coverage detected