1 | sclass StrictTreeMap<A, B> extends TreeMap<A, B> { |
2 | bool detailedExceptions; |
3 | |
4 | public B put(A key, B value) { |
5 | B v = get(key); |
6 | if (v != null && neq(v, value)) |
7 | if (detailedExceptions) |
8 | fail("Strict map conflict: " + structure(key) + ", " + structure(get(key)) + ", " + structure(value)); |
9 | else |
10 | fail("Trying to change strict map."); |
11 | ret super.put(key, value); |
12 | } |
13 | } |
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1003482 |
Snippet name: | StrictTreeMap - non-overwrite TreeMap (doesn't allow modification, only adding) |
Eternal ID of this version: | #1003482/1 |
Text MD5: | df422913676a4a8e663b417a510aac93 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2016-10-18 19:33:29 |
Source code size: | 416 bytes / 13 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 629 / 1620 |
Referenced in: | [show references] |