1 | sclass MechListDependentCaches<A> { |
2 | Map<S, MechListDependentCache<A>> byList = ciMap(); |
3 | O maker; // func(S) -> A |
4 | transient Lock lock = lock(); |
5 | |
6 | *(O *maker) {} |
7 | |
8 | A get(S name) { |
9 | MechListDependentCache<A> listCache; |
10 | { |
11 | lock lock; |
12 | listCache = byList.get(name); |
13 | if (listCache == null) |
14 | byList.put(name, listCache |
15 | = MechListDependentCache(name, maker)); |
16 | } |
17 | ret listCache!; |
18 | } |
19 | } |
Began life as a copy of #1022393
download show line numbers debug dex old transpilations
Travelled to 9 computer(s): bhatertpkbcr, cfunsshuasjs, lnbujpyubztb, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, whxojlpjdney
No comments. add comment
Snippet ID: | #1022395 |
Snippet name: | MechListDependentCaches |
Eternal ID of this version: | #1022395/5 |
Text MD5: | 204a685786ba06cd1bdc8e5d9301c5f8 |
Author: | stefan |
Category: | javax / a.i. |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-03-16 17:25:12 |
Source code size: | 451 bytes / 19 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 340 / 832 |
Version history: | 4 change(s) |
Referenced in: | [show references] |