1 | static class CombinedMap<A, B> extends AbstractMap<A, B> { |
2 | new L<Map<A, B>> maps; |
3 | |
4 | *() {} |
5 | *(Map<A, B>... maps) { addAllNonNulls(this.maps, maps); } |
6 | <C extends Map<A, B>> *(Collection<C> maps) { addAllNonNulls(this.maps, maps); } |
7 | |
8 | public int size() { ret lengthLevel2_maps(maps); } |
9 | public Set<Map.Entry<A, B>> entrySet() { fail(); } |
10 | public bool containsKey(O o) { |
11 | for (Map<A, B> map : maps) |
12 | if (map.containsKey(o)) |
13 | true; |
14 | false; |
15 | } |
16 | |
17 | @Override |
18 | public B get(O o) { |
19 | for (Map<A, B> map : maps) |
20 | if (map.containsKey(o)) |
21 | ret map.get(o); |
22 | null; |
23 | } |
24 | } |
Began life as a copy of #1021317
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1022360 |
Snippet name: | CombinedMap - only supports containsKey() and get() |
Eternal ID of this version: | #1022360/5 |
Text MD5: | 29640b5039bac0abe77b514567cda1f1 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-05-24 19:24:21 |
Source code size: | 629 bytes / 24 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 271 / 717 |
Version history: | 4 change(s) |
Referenced in: | [show references] |