| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- import java.util.*;
- /**
- * Write a description of class Bin here.
- *
- * @author (your name)
- * @version (a version number or a date)
- */
- public class Bin
- {
-
-
- private Map<Integer, Integer> entries = new TreeMap();
-
- public Bin(){
- entries.put(2,0);
- entries.put(3,0);
- entries.put(4,0);
- entries.put(5,0);
- entries.put(6,0);
- entries.put(7,0);
- entries.put(8,0);
- entries.put(9,0);
- entries.put(10,0);
- entries.put(11,0);
- entries.put(12,0);
-
- }
-
-
- public void counter(Integer key){
- Integer count = entries.get(key);
- entries.put(key, count +1);
-
- }
-
- public Integer getValue(int key){
- return entries.get(key);
- }
-
-
- }
|