Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

20
LINES

< > BotCompany Repo | #1001027 // class DerivedHashMap - base map + additions

JavaX fragment (include)

1  
static class DerivedHashMap<A, B> extends AbstractMap<A, B> {
2  
  Map<A, B> base;
3  
  new HashMap<A, B> additions;
4  
  
5  
  *(Map<A, B> *base) {}
6  
  
7  
  public B get(Object key) {
8  
    B b = additions.get(key);
9  
    if (b != null) return b;
10  
    return base.get(key);
11  
  }
12  
  
13  
  public B put(A key, B value) {
14  
    return additions.put(key, value);
15  
  }
16  
  
17  
  public Set<Map.Entry<A,B>> entrySet() {
18  
    throw fail();
19  
  }
20  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1001027
Snippet name: class DerivedHashMap - base map + additions
Eternal ID of this version: #1001027/2
Text MD5: f62569bb25f5084e80f584b14972080f
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-07-22 13:40:21
Source code size: 426 bytes / 20 lines
Pitched / IR pitched: No / No
Views / Downloads: 555 / 1280
Version history: 1 change(s)
Referenced in: [show references]