MCPcopy Create free account
hub / github.com/BruceEckel/OnJava8-Examples / main

Method main

patterns/recyclec/RecycleC.java:56–70  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

54
55public class RecycleC {
56 public static void main(String[] args) {
57 TrashBin<Trash> bin =
58 new TrashBin<>(Trash.class);
59 ParseTrash.fillBin("trash", bin);
60 @SuppressWarnings("unchecked")
61 TrashBinList<Trash> trashBins =
62 new TrashBinList<>(
63 Aluminum.class, Paper.class, Glass.class,
64 // Add one item:
65 Cardboard.class // [3]
66 );
67 trashBins.sortBin(bin); // [4]
68 trashBins.show();
69 TrashValue.sum(bin, "Trash");
70 }
71}
72/* Output:
73Loading patterns.trash.Cardboard

Callers

nothing calls this directly

Calls 4

fillBinMethod · 0.95
sortBinMethod · 0.95
showMethod · 0.95
sumMethod · 0.95

Tested by

no test coverage detected