Libraryless. Click here for Pure Java version (2562L/16K).
1 | static <A, B> L<B> lambdaMapLike convertListElementsBothWays(IF1<A, B> fGet, IF1<B, A> fSet, L<A> l) {
|
2 | ret new RandomAccessAbstractList<B> {
|
3 | final int size = l(l); |
4 | |
5 | public int size() { ret size; }
|
6 | public B get(int i) {
|
7 | ret fGet.get(l.get(i)); |
8 | } |
9 | public B set(int i, B b) {
|
10 | B old = get(i); |
11 | l.set(i, fSet.get(b)); |
12 | ret old; |
13 | } |
14 | }; |
15 | } |
Began life as a copy of #1018394
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
| Snippet ID: | #1029235 |
| Snippet name: | convertListElementsBothWays - virtual list with two converters for both getting and setting |
| Eternal ID of this version: | #1029235/4 |
| Text MD5: | 67f180aa3b3983ce94be8b652c9365b3 |
| Transpilation MD5: | ac122921cc0e44b12d5731e448b79398 |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2020-07-26 20:00:05 |
| Source code size: | 392 bytes / 15 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 478 / 603 |
| Version history: | 3 change(s) |
| Referenced in: | [show references] |