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

Method sum

patterns/trash/TrashValue.java:11–20  ·  view source on GitHub ↗
(List<? extends Trash> bin, String type)

Source from the content-addressed store, hash-verified

9public class TrashValue {
10 private static double total;
11 public static void
12 sum(List<? extends Trash> bin, String type) {
13 total = 0.0;
14 bin.forEach( t -> {
15 System.out.println(t);
16 total += t.weight * t.price();
17 });
18 System.out.printf(
19 "Total %s value = %.2f%n", type, total);
20 }
21}

Callers 10

mainMethod · 0.95
showMethod · 0.95
mainMethod · 0.95
showMethod · 0.95
showMethod · 0.95
mainMethod · 0.80
mainMethod · 0.80
mainMethod · 0.80
mainMethod · 0.80
mainMethod · 0.80

Calls 1

priceMethod · 0.45

Tested by

no test coverage detected