Libraryless. Click here for Pure Java version (3123L/18K).
1 | // does not store null values |
2 | static <B, A> MultiMap<B, A> lambdaMapLike multiMapIndex(IF1<A, B> f, Iterable<A> l) { |
3 | new MultiMap<B, A> map; |
4 | fOr (A a : l) { |
5 | B val = f.get(a); |
6 | if (val != null) |
7 | map.put(val, a); |
8 | } |
9 | ret map; |
10 | } |
11 | |
12 | |
13 | static <B, A> MultiMap lambdaMapLike multiMapIndex(Iterable<A> l, IF1<A, B> f) { |
14 | ret multiMapIndex(f, l); |
15 | } |
Began life as a copy of #1011312
download show line numbers debug dex old transpilations
Travelled to 8 computer(s): bhatertpkbcr, ekrmjmnbrukm, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1027804 |
Snippet name: | multiMapIndex |
Eternal ID of this version: | #1027804/6 |
Text MD5: | 0099a133b91c1b09038d181be1f7959a |
Transpilation MD5: | 5e2eaa77262b194f7f641d593d7c0ab8 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-06-28 15:32:12 |
Source code size: | 369 bytes / 15 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 191 / 299 |
Version history: | 5 change(s) |
Referenced in: | [show references] |