Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public abstract class Cache<K, V> {
- private Map<K, V> map = new HashMap<>();
- public void add(K key, V val) {
- map.put(key, val);
- }
- public void remove(K key) {
- map.remove(key);
- }
- public boolean has(K key) {
- return map.containsKey(key);
- }
- public V get(K key) {
- return map.get(key);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement