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

Method count

reflection/PetCounter.java:11–17  ·  view source on GitHub ↗
(String type)

Source from the content-addressed store, hash-verified

9public class PetCounter {
10 static class Counter extends HashMap<String,Integer> {
11 public void count(String type) {
12 Integer quantity = get(type);
13 if(quantity == null)
14 put(type, 1);
15 else
16 put(type, quantity + 1);
17 }
18 }
19 private Counter counter = new Counter();
20 private void countPet(Pet pet) {

Callers

nothing calls this directly

Calls 2

getMethod · 0.65
putMethod · 0.45

Tested by

no test coverage detected