1 | static <A> L<A> joinStreaks(O filter, O joiner, L<A> l) { |
2 | int start = 0; |
3 | new L out; |
4 | for (int i = 0; i < l(l); i++) { |
5 | if (!isTrue(callF(filter, l.get(i)))) { |
6 | if (i == start+1) |
7 | out.add(l.get(start)); |
8 | else if (i > start) |
9 | out.add(callF(joiner, subList(l, start, i))); |
10 | start = i+1; |
11 | out.add(l.get(i)); |
12 | } |
13 | } |
14 | if (start == l(l)-1) |
15 | out.add(l.get(start)); |
16 | else if (l(l) > start) |
17 | out.add(callF(joiner, subList(l, start))); |
18 | ret out; |
19 | } |
download show line numbers debug dex old transpilations
Travelled to 12 computer(s): bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1019353 |
Snippet name: | joinStreaks |
Eternal ID of this version: | #1019353/1 |
Text MD5: | 15e9f3fb8eb42ac4b70e941995e854d7 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-11-03 14:43:00 |
Source code size: | 508 bytes / 19 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 282 / 315 |
Referenced in: | [show references] |