()
| 98 | } |
| 99 | |
| 100 | public T getMostFrequent() { |
| 101 | T t = null; |
| 102 | int max = 0; |
| 103 | for (T key : data.keySet()) { |
| 104 | MutableInt count = data.get(key); |
| 105 | if ( count.asInt()>max ) { |
| 106 | max = count.asInt(); |
| 107 | t = key; |
| 108 | } |
| 109 | } |
| 110 | return t; |
| 111 | } |
| 112 | } |