Advertisement
Guest User

Untitled

a guest
Sep 19th, 2015
393
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.49 KB | None | 0 0
  1. import java.util.Map.Entry;
  2.  
  3. public final class MapEntry implements Entry<String, Integer> {
  4.  
  5.     private final String key;
  6.     private Integer value;
  7.    
  8.     public MapEntry(String key, Integer value) {
  9.         this.key = key;
  10.         this.value = value;
  11.     }
  12.  
  13.     @Override
  14.     public String getKey() {
  15.         return key;
  16.     }
  17.  
  18.     @Override
  19.     public Integer getValue() {
  20.         return value;
  21.     }
  22.  
  23.     @Override
  24.     public Integer setValue(Integer value) {
  25.         Integer v = this.value;
  26.         this.value = value;
  27.         return v;
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement