Advertisement
Guest User

Untitled

a guest
Nov 19th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.41 KB | None | 0 0
  1. public void update(String key, String oldValue, String newValue){
  2.  
  3.         if(dictionary.containsKey(key)){
  4.             if(lookup(key).containsValue(oldValue)){
  5.  
  6.                 List<String> tmp = new ArrayList<>();
  7.                 tmp = dictionary.get(key);
  8.                 tmp.remove(oldValue);
  9.                 tmp.add(newValue);
  10.  
  11.                 dictionary.put(key, tmp);
  12.  
  13.             }
  14.         }
  15.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement