Download Jar. Libraryless. Click here for Pure Java version (7232L/47K).
1 | !7 |
2 | |
3 | static SimpleLiveValue<S> output = new(S); |
4 | static Map<Class, Bool> hasUpdateMethod = weakHashMap(); |
5 | static Method baseMethod; |
6 | |
7 | static JComponent visualize() { |
8 | ret centerLabel(makeBold(setFontSize(40, jLiveValueLabel(output)))); |
9 | } |
10 | |
11 | p { |
12 | baseMethod = findInstanceMethod(getClass(creator(), 'main$Module), 'update); |
13 | } |
14 | |
15 | svoid update { |
16 | L modules = cast call(creator(), 'onModules); |
17 | int count = 0; |
18 | for (O m : modules) { |
19 | Class c = m.getClass(); |
20 | Bool hasUpdate = hasUpdateMethod.get(c); |
21 | if (hasUpdate == null) |
22 | hasUpdateMethod.put(c, |
23 | hasUpdate = findMethod(m, 'update) != baseMethod); |
24 | if (hasUpdate) ++count; |
25 | } |
26 | output.set(str(count)); |
27 | } |
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1015824 |
| Snippet name: | #Modules With Update Function [Dyn Module] |
| Eternal ID of this version: | #1015824/4 |
| Text MD5: | b74e4afd70cefa230cf71cb5cbaf8b95 |
| Transpilation MD5: | 2d21117f778ad0bfca0e754f9f9a407a |
| Author: | stefan |
| Category: | |
| Type: | JavaX source code (desktop) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2018-05-28 04:05:27 |
| Source code size: | 674 bytes / 27 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 773 / 2225 |
| Version history: | 3 change(s) |
| Referenced in: | [show references] |