T
- Key type to be countpublic final class CountingMap<T> extends Object
Constructor and Description |
---|
CountingMap() |
Modifier and Type | Method and Description |
---|---|
void |
add(CountingMap<T> otherMap) |
void |
add(T key,
int value)
Adds i to the value of key.
|
int |
get(T key) |
void |
increment(T key)
Increments the value of key by one.
|
int |
size() |
String |
toString() |
public void increment(T key)
key
- The key which sould be incrementedpublic void add(T key, int value)
key
- the key which is used to add i.value
- the value to be added.public void add(CountingMap<T> otherMap)
public int get(T key)
public int size()
Copyright © 2015–2020. All rights reserved.