Libraryless. Click here for Pure Java version (2468L/16K).
1 | scope ai_findVarObjects. |
2 | |
3 | static <A> L<A> nuLike ai_findVarObjects(Class<A> varClass, O root) {
|
4 | ret ai_findVarObjects(varClass, root, null); |
5 | } |
6 | |
7 | static <A> L<A> nuLike ai_findVarObjects(Class<A> varClass, O root, IF1<O, Bool> objectFilter) {
|
8 | Cl out = transitiveHullOfFunction(o -> #scanObject(o, objectFilter), root); |
9 | ret instancesOf(varClass, out); |
10 | } |
11 | |
12 | static L #scanObject(O o, IF1<O, Bool> objectFilter) {
|
13 | ret filter(nsnpntFieldValues_withoutOuterRefs(o), |
14 | v -> v != null && !v instanceof S |
15 | && (objectFilter == null || objectFilter.get(v))); |
16 | } |
17 | |
18 | end scope |
download show line numbers debug dex old transpilations
Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1025416 |
| Snippet name: | ai_findVarObjects - deep-scan objects and find variables of a custom type |
| Eternal ID of this version: | #1025416/8 |
| Text MD5: | 05770efe237e9313a92fe1660c938a04 |
| Transpilation MD5: | c4f13a1d81b9f48c676add57db589676 |
| Author: | stefan |
| Category: | javax / a.i. |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2019-09-28 21:08:51 |
| Source code size: | 591 bytes / 18 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 499 / 645 |
| Version history: | 7 change(s) |
| Referenced in: | [show references] |